Results 1 to 12 of 12

Thread: Help with randoms

  1. #1
    Join Date
    Jun 2007
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help with randoms

    I am currently editting the auto-ranger "shoot em up ranger" and so far i have added arrow equiping to it, but i would also like to have it log out every few minutes to avoid randoms, like in forefeathers, and i wasnt exactley sure how i was supposed to do that. This is what i put into my main script in order to try it out. (I got this piece from forefeathers, i am not tryign to take it as my own idea) If anyone could tell me how i would go about doing this that would be great, ill give +rep


    PHP Code:
                Begin
      Setup
    ;
      
    InitPlayer;
        
    Repeat
        EquipArrows
    ;
          If(
    KillHPBars)Then
            Begin
              
    If(Not PickUpArrows)Then
                
    Break;
            
    End Else KillMinotaur;
                
    Wait(1000+Random(250));  //this is where i tried to put it in 
                
    if not(loggedInthen         //from here down
        
    begin
          logout
    ;
          if 
    HowManyPlayers<=1 then
          begin
            players
    [currentplayer].active:=false;
            break;
          
    end;
          
    nextplayer(false);
          
    ck:=0;
          
    loginPlayer;
          
    marktime(s);
        
    end;
        if 
    timefrommark(s)>900000 then
        begin
          logout
    ;
          if 
    HowManyPlayers=1 then
          begin
            xWait
    :=random(60000);
            
    marktime(minMark);
            
    repeat
              wait
    (1000);
              
    status(inttostr((xWait-timefrommark(minMark))/1000)+' seconds');
            
    until(timefrommark(minMark)>xWait);
          
    end;
          
    nextplayer(true);
          
    ck:=0;
          
    marktime(s);
          
    loginPlayer;
        
    end;
      
    until(false);
    end.
    End

  2. #2
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Read a tutorial. Rep+ please?

    just go like this

    SCAR Code:
    procedure Sleep(mins: integer);
    begin
      Logout;
      Wait(mins*60);
      LoginPlayer;
    end;
    ~ Metagen

  3. #3
    Join Date
    Jun 2007
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well, but if i want it to run for like lets say 10 minutes before it logs out, then what would i put?

    PHP Code:
      marktime(x)
      
    repeat until (marktime(x)>3000then
      Logout
    ;
      
    Wait(mins*60);
      
    LoginPlayer

  4. #4
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure Sleep(mins: integer);
    begin
      Logout;
      Wait(mins*60);
      LoginPlayer;
    end;

    begin
      marktime(x);
      repeat
        //blahblah code
        if timefrommark(x) < 12345 then
        begin
          sleep(12345);
          marktime(x);
        end;
      until whatever
    end.
    ~ Metagen

  5. #5
    Join Date
    Jun 2007
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh ok thank you very much, but two more questions. Do you have to define what mins equals? And do they have it so if you put in 60 it is one minute?

  6. #6
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I just wrote that lil thing

    basically just type in sleep(1); and it will sleep for 1 minute
    ~ Metagen

  7. #7
    Join Date
    Jun 2007
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh alright lol, thank you ver y much for the help. +rep

  8. #8
    Join Date
    Jun 2007
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry to bring this back up so soon, but i try to implement that into the script im editing and i keep getting errors. This is the way i have it. I keep getting errors like
    Line 432: [Error] (13075:1): Identifier expected in script


    SCAR Code:
    Begin
      Setup;
      InitPlayer;
      MarkTime(x);
        Repeat
        EquipArrows;
          If(KillHPBars)Then
            Begin
              If(Not PickUpArrows)Then
                Break;
                Else KillMinotaur;
                timefrommark(x) < 600000 then
                begin
                     logout;
                     sleep(2);
                     LoginPlayer;
                     MarkTime(x);
            End;
            End;
    End.

  9. #9
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Begin
      Setup;
      InitPlayer;
      MarkTime(x);
        Repeat
        EquipArrows;
          If(KillHPBars)Then
            Begin
              If(Not PickUpArrows)Then
                Break;
                Else KillMinotaur;
                timefrommark(x) < 600000 then
                begin
                     logout;
                     sleep(2);
                     LoginPlayer;
                     MarkTime(x);
            End;
            End;
         Until () // you need this if you have a repeat.
    End.


    okay, just like every begin, you need an end. well, for every repeat, you need an until. repeat...blabla...until

  10. #10
    Join Date
    Apr 2008
    Posts
    0
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for the help

  11. #11
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Or you can do:
    SCAR Code:
    Function TimeToSleep : Boolean;
    Begin
     If LoggedIn Then Exit;
      Case Random(4) of
        1: Wait(60000+Random(3000));
        2: Wait(30000+Random(300));
        3: Wait(Random(9999));
        0: FTWait(800+Random(80));
      end;
    end;
    ^ Note FTWait is what I would personally use as it also moves the mouse randomly as it waits ^

    So you could use it like this:

    SCAR Code:
    If TimeToSleep then
      WriteLn(' Going to sleep ');
      LogOut;

    e.t.c

    Hope I Helped

  12. #12
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    gj u stole my epic old script ^^

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How To Add Randoms??
    By flamingvenom in forum OSR Help
    Replies: 3
    Last Post: 09-25-2008, 06:26 AM
  2. Help with randoms
    By trav280 in forum OSR Help
    Replies: 3
    Last Post: 04-27-2008, 07:10 AM
  3. Replies: 3
    Last Post: 03-31-2007, 02:34 AM
  4. randoms
    By falven in forum OSR Help
    Replies: 35
    Last Post: 12-28-2006, 04:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •