Jump to content

Stormfolk

Members
  • Posts

    289
  • Joined

  • Last visited

Posts posted by Stormfolk

  1. I'm working on exercises about vb.net arrays. In this exercise I have to read in some data from a .txt file and place it in a 1 dimensional array. It has to do some other things later too, but that's not important atm. Basically, it is a text file with names and a result.

     

    The textfile looks like this:

     

    99020860.png

    As you can see the data is seperated by a "-".

     

    I managed to get it all working with this code:

     

    Public Class Form1
    
       Private Sub btnSluiten_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSluiten.Click
           Me.Close()
       End Sub
    
       Private Sub btnInlezen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInlezen.Click
           'declare
           Dim record As String
           Dim index As Integer = -1
           Dim position As Integer
    
           Dim name() As String
           Dim result_a() As Integer
    
           ‘The textfile
           FileOpen(1, "gegevens.txt", OpenMode.Input) 'standaardwaarde inlezen is 1
    
           'read data from the textfile
           Do While Not EOF(1)
               'raise index
               index += 1
    
               'read lines of the textbox
               record = LineInput(1)
    
               'preserve 
               ReDim Preserve name(index)
               ReDim Preserve result_a(index)
    
               'seperate the data in the txt
               position = record.IndexOf("-")
    
               'fill the arrays
               name(index) = record.Substring(0, position)
               result_a(index) = record.Substring(position + 1)
    
               'show array
               txtData.Text += name(index).ToString & vbTab & result_a(index).ToString & vbNewLine
           Loop
    
           ‘close txt
           FileClose(1)
       End Sub
    End Class
    

     

    How the program looks like after the text has been read:

    65928783.png

     

     

     

    So far that's all ok, but I wanted to go a little bit further. In stead of 2 pieces of data on each line of the textfile, I wanted to make it work for when there's 3, 4, 5, ... things. Now there's just a result_a, but what if there's a result_b, result_c, ...

     

    For example:

     

    Mia-75-53-82-65

    Jan-85-94-78-66

     

    I've been trying and testing things for most of the day, looked things up on the internet, ... but somehow I'm missing the point on how to get this done. I couldn't find a proper explanation for it either.

     

    I tried to do something like, but apperently that was too easy to work :P :

     

    result_a(index) = record.Substring(position + 1)
    result_b(index) = record.Substring(position + 2)
    result_c(index) = record.Substring(position + 3)

     

    But then something goes wrong with the splitting based on the "-" symbol. It seems to fail to jump further and get the next piece of data in the line.

     

    I also tried adding in this again before I moved to the result_b and after I read in result a, but that didn't do the trick either.

     

                position = record.IndexOf("-")

     

    Anyone here has an idea, and preferably an explanation on how to do this for a name and 2,3,4, ... results? I'm hoping I can find a general theory or a general way so I can use this basic code to read in files with few data, but also files with more data. So yea, if you can help this vb noob it would be greatly appreciated.

  2. The problem indeed seems to lie with reloading/refreshing the settings. It works now.

     

    The script:

     

    Set WshShell = WScript.CreateObject("WScript.Shell")
    
    'Variable for the screensaver
    scrsvr = "C:\Windows\SysWOW64\Screensaver Operations.scr"
    
    'Assign the screensaver to the current user in the registry
    WshShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE[Caution: Executable File]", scrsvr, "REG_SZ"
    
    'Activate the screensaver
    WshShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveActive", 1, "REG_SZ"
    
    'Screensaver has to wait 600 seconds (10 minutes) before it starts
    WshShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveTimeOut", 600, "REG_SZ"
    

     

    I just got confused by the fact that for all settings aside from ScreenSaveTimeOut you immediately get a visual result. For ScreenSaveTimeOut, the user first has to log off and on again to see the changes.

     

    Thanks everyone!

  3. I have been working on a script to make settings for the screensaver for All Users on a Windows 7 Pro PC.

     

    In my script, I also want to update the waiting time before the screensaver starts by adjusting a registry key.

    I've been looking on the internet for quite some time now, but I can't find the right key that does it.

     

    First I thought "HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveTimeOut", 600, "REG_SZ" would do the trick, but that's not the one I need.

     

    timescreensaver.png

    The red box is the part I want the registry key for. The "5" should be "10".

     

    I know it can be easily done by rightclicking the desktop, changing screensaver settings with the console, but I really need to do it with the registry key.

    Anyone has an idea?

  4. trwfnonamespg3.png

    TRWF | GMT based PVP clan | trwf-rs.net | #trwf on irc.seersirc.net

     

     

    Written by Wouter, copy-pasted by me :ugeek:

     

    We set up a fight with LPT for this fine Monday, not being able to get a fight for last night we were all looking forward to it. We headed out with 35 strong Warhungers and awaited for LPT to come up with around 30 as well. They set to DD and we rushed them.

     

    The start of the fight was ours, we sent snipers immediately and just tore through their pile. After around 30 minutes we let it slip and LPT had a strong comeback with a solid main pile and it was even, but near the end our top calling and amazing styles prevailed and we did work again. We ended strong with 38 out of 40 people in game, LPT ended with a good 30.

     

    Thanks for a great fight LPT, hopefully we can have one again soon.

     

    Thanks to LF for ac'ing all the randoms sniping us, appreciated seeing the circumstances :)

     

    Trwf starting: 105

    LPT starting: 90

     

    Trwf ending: 114

    LPT ending: 90

     

    Welcome to Swaggerville Miikezilla.

     

    [22:05:07] <Trioske12> womens' place is in kitchen

     

    Pics:

     

    file-3.jpg

     

    Starting:

    file.jpg

     

    Trwf Ending:

    file-1.jpg

     

    LPT Ending:

    file-2.jpg

  5. trwfnonamespg3.png

    TRWF | GMT based PVP clan | www.warhungers.com | #trwf on irc.seersirc.net

     

     

    We had two fights today, a pkri with RKOF and a fight with The Clan for the 20v20 section of the Jagex Cup.

     

    TRWF vs RKOF

     

    Rkof approached us looking for a challenge and we quickly set up a 1 hour cap with the following rules.

     


    1.  
    2. All styles
    3. 5 snipers
    4. DG/COR OFF
    5. Spiders - GDS rock
    6. Low ops attack

     

    We pulled a solid 40-ish and Rkof had around 30. Nonetheless we set up to defend and Rkof rushed us. From the start we were doing work and Rkof had to do a few regroups but they recovered well each time, after around 30-40 minutes of fighting they decided to call of and we took ending with a solid 40 and then we logged out.

     

    Thanks for the fight RKOF and good luck in your future fights.

     

    Trwf starting opts: 120

    RKOF starting opts: 90

     

    Trwf ending opts: 120

    RKOF ending opts: 0

     

    Starting:

    110807190426.png

     

    Ending(-30 opts due to assist)

    110807213306.jpg

     

     

    TRWF vs The

     

    We set up our 20v20 for the JCUP to take place today at 4 EST.

     

    We set out into the portal and selected our 20 best fighters to match with THE's 17.

     

    We had possibly one of the worst starts I've seen in a long time with THE getting a quick 1 hit and nearly another one. So we kept the 2 kill gap for about 5 more kills and then we just went through all the blasters and ko'd them left and right. We quickly finished up our fight with some solid tanking from some of our members.

     

    Thanks for the fight THE and good luck in your future fights.

     

    110807221901.png

  6. trwfnonamespg3.png

    TRWF | GMT based PVP clan | www.warhungers.com | #trwf on irc.seersirc.net

     

     

    Written by Wouter:

    We set up a fight with Exalt and were well excited to fight a new clan, we headed up with a solid 35 people and quickly defended and waited for them to rush. We immediately got rolling and were quickly ko'ing mages left and right. We didn't send our snipers until the last 20 minutes where we had to stop to clear crashers. Shortly before the end Exalt called it off not wanting to deal with crashers. Thanks for the fight, hopefully we can do it again sometime.

     

    Trwf starting: 111

    Exalt starting: 84

     

    Trwf ending: 120(43 on TS)

    Exalt: 0

     

    hFPS8.png

     

    Trwf Starting:

    110731220426.jpg

     

    Exalt Starting:

    dfkjhdsjfh.png

     

    Trwf Ending:

    hsry9y.png

     

    110731221322.png

     

    110731220040.png

  7. trwfnonamespg3.png

    TRWF | GMT based PVP clan | www.warhungers.com | #trwf on irc.seersirc.net

     

     

    Written by James:

     

    Earlier this week we found out that LPT were pking so we decided to make a pk trip to intercept them! We massed for a short period of time and entered the wilderness with 20 strong warriors! We had asked LPT if they would like a planned fight but they declined so we decided to hit them. After a short time playing hide and seek we finally hit them and the battle commenced!

     

    TRWF Starting: 20

     

    LPT Starting: 20ish

     

     

    The fight started pretty even until we started to clear their binders and blasters then the fight became pretty one sided. We fought them for around an hour until some crap clan rushed lpt whilst we were the other side of the wilderness so didnt know what was happening. Lpt switched worlds and ended.

     

    TRWF Ending: 26

    110721231718.png

     

    Lpt Ending: No idea they just left the world

     

    110721230657.png

    110721230506.png

    110721225648.png

    110721224021.png

    110721214151.png

    110721214644.png

    110721214745.png

    110721214927.png

    110721215252.png

    110721215716.png

    110721215809.png

    110721220449.png

    110721220758.png

    110721210539.png

    110720235022.png

    110721224026.jpg

    110721224143.jpg

     

    After the LPT fight we headed over the Cor and Tr's fight and ac'd a little bit. We had a small scrap with some team that was crashing, they had alot more than us and instantly bailed to single as soon as we started transitioning over all of them.

     

    We killed a tr member who was wearing welfare gear so apologies for that.

     

    Shout Out to seccy for just wanting to own.

  8. So I heard the new Lock Up album today, and all I can say... holy [cabbage]. Not album of the year (especially not in a year when AUTOPSY, AUTOPSY, AUTOPSY have released an early candidate for album of the decade), but better than Pleasures Pave Sewers and about on a par with Hate Breeds Suffering. It's called Necropolis Transparent if anyone's interested.

     

    New Exhumed (All guts, no glory) is good too, dunno if you heard that one already.

     

  9. trwfbannerfire.png

    TRWF | GMT based PVP clan | www.warhungers.com | #trwf on irc.seersirc.net

     

     

    Written by Mr Steedman himself:

     

    TRWF and MMA had a small prep for a 1:30 hours pkri. After a hard battle the warhungers were able to pull together well in the last 20 minuits to make an epic end that what had been a hard battle, whilst being outnumbered heavily most of the fight. Great job tonight Warhungers, be proud!

     

    Starting

     

    Trwf Starting: 84 ops

    110717200755.png

     

    MMa starting: 43 on ts?

     

    Immediate ending opitons.

     

    TRWF: 84

    capture17072011213049.png

     

    MMA: 81

    capture17072011213047.png

     

     

    Some pictures of the fight:

     

    capture17072011213027.png

     

    110717232602.png

     

    110717213042.png

     

    Ending options were close, but given the numbers the win was ours.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.