Results 1 to 15 of 15

Thread: XP per hour?

  1. #1
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default XP per hour?

    Hey what's up? I just made a script for a private server that ran flawlessly all night and made me 800m. Man I feel awesome ^_^ But anyway I'm trying to make a debug box that'll show my exp per hour. But I'm unsure on the value of GetTimeRunning. Is it in seconds milliseconds minutes hours? How would I set this up to find exp per hour if the exp per hour is say 500? I don't understand how I'm getting the value of 48.------- for GetTimeRunning.. Might be over thinking something idk. Help would be much appreciated

    Edit- I'm pretty sure I'm getting a permanently set value of 48 because I tried doing round(xp/x) where xp raises by 500 each time it goes and x is GetTimeRunning and it came up with 10 the next time I got a steal xp goes up and I get 20 ect.

    2nd Edit- Pretty sure I put this in the wrong section.. I'm going back to bed -_-
    Last edited by Dinosaurrr; 12-06-2012 at 01:15 PM.

  2. #2
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Thread moved: Development Tutorials -> Scripting Help.

    GetTimeRunning is in milliseconds (1/1000th of a second, so: 1000 milliseconds is the equivalent of one second).
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  3. #3
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Appreciate the help thanks

  4. #4
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    -in the main program begin. Not in repeated part.
    coins:=0;
    gaingp:=30000; 
    
    -in the main program begin but in the repeated part.
    s := GetTimeRunning;
    
    -in the main procedure after it does the needed procedure to earn the gp.
    IncEx(coins, gaingp);
    
    -In the paint procedure in the main program repeated part.
    
    Writeln('Gained coins: ' + ToStr(coins))
    Writeln('Coins per hour: ' + ToStr(Round(3600*(coins)/(s/(1000)+1))));
    Why would this gives me negative amount of coins per hour after running the script for a few minutes?

    Edit - Never mind got it.
    Edit 2 - Grr.. Thought I did but it just ran for longer and then failed Way more annoying than php and html combined..

    Edit 3 - Came to the conclusion it isn't me.. So it's gonna have to be wrong I guess *shrugs*
    Last edited by Dinosaurrr; 12-06-2012 at 03:13 PM.

  5. #5
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It does it after it hits running time of 60 seconds or more. No idea why...

  6. #6
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Dinosaurrr View Post
    It does it after it hits running time of 60 seconds or more. No idea why...
    type integer can only be so big before it floats off into the mystery lands

  7. #7
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    type integer can only be so big before it floats off into the mystery lands
    Just figured that out had to / the coins by 1000 and put K on the end Thank you so much

    edit - Unless there is a way to make a bigint??

  8. #8
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Simba Code:
    var
      i: Int64;

  9. #9
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Anything that'd show me how exactly to use that?

    Code:
    IntToStr(i:int64): String
    How exactly would I use something like that?

    Code:
    IntToStr(i):Round(3600*(coins)/(ms/1000)))
    Was also playing around with it and saw a function Int64ToStr?

  10. #10
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Generally i just ToStr() everything.
    please post the calculation you're doing. int64 is a type similar to integer but can hold a larger value. Use it the same way you used integer.

  11. #11
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    vars are all set to integer

    in the main begin and end;
    coins:=0;
    gaingp:=30313;

    In the procedure making the gp
    IncEx(coins, gaingp);

    In paint procedure
    ms:= GetTimeRunning;
    Writeln('Gained coins: ' + ToStr(coins))
    Writeln('Coins per hour: ' + ToStr(Round(3600*(coins)/(ms/1000))));

    Just trying to make it give me the amount of coins per hour I'd get if I got 30313 per stall steal it's a thieving bot so it's pretty quick. I'll post the entire script if that's not enough info

  12. #12
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    just post the whole thing man.

  13. #13
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program FishTheiver;
    var
    x, y: Integer;
    c, d: Integer;
    xp: Integer;
    theives: Integer;
    mode: Integer;
    ms: Integer;
    brawler: Integer;
    coins: Integer;
    gaingp: Integer;
    
    const
    BRAWLERCOLOR = 602420; //602420 brown, 6439284 purple.
    BORDERWIDTH = 16; //Black border around game.
    BRAWLERS = ('No'); //Use brawlers? 'Yes' or 'No'
    
    Procedure CheckBrawlers;
      begin
        if (BRAWLERS = 'Yes') then
          begin
            if FindColorTolerance(x, y, BRAWLERCOLOR, 568+(BORDERWIDTH), 371, 599+(BORDERWIDTH), 396, 10 ) = false then
              begin
                PressKey(112);
                repeat
                  Wait(50);
                until(FindColorTolerance(x, y, 1482692, 550+(BORDERWIDTH), 205, 735+(BORDERWIDTH), 461, 10) = true);
                if FindColorTolerance(x, y, BRAWLERCOLOR, 550+(BORDERWIDTH), 205, 735+(BORDERWIDTH), 461, 10) = true then
                    begin
                      MoveMouse(x, y);
                      repeat
                        wait(100);
                      until(FindColorTolerance(c, d, 3768029, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 30) = true);
                      ClickMouse(x, y, 1);
                      repeat
                        wait(50);
                      until(FindColorTolerance(c, d, 3768029, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 30) = false);
                      PressKey(113);
                      repeat
                        wait(50);
                      until(FindColorTolerance(x, y, BRAWLERCOLOR, 570+(BORDERWIDTH), 368, 602+(BORDERWIDTH), 400, 10) = true);
                      IncEx(brawler, 1);
                    end;
                end;
          end;
      end;
    
    
    Procedure Theive;
      begin
        if FindColorTolerance(x, y, 9611960, 0, 0, 513+(BORDERWIDTH), 332, 5) = true then
          begin
            MoveMouse(x, y);
            wait(100);
            if (FindColorTolerance(c, d, 15724822, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 40) = true) then
             begin
               ClickMouse(x, y, 1);
               repeat
                 wait(50);
               until(FindColorTolerance(c, d, 15724822, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 40) = false);
               IncEx(xp, mode);
               IncEx(theives, 1);
               IncEx(coins, gaingp);
               wait(500);
             end;
          end;
      end;
    
    Procedure Paint;
      begin
        ms:= GetTimeRunning;
        if (ms > 0) then
          begin
            Writeln('--------------------------------------------------')
            Writeln('----------Dinosaurrr Soulsplit Theiving-----------')
            Writeln('Time ran: ' + ToStr(Round(ms/1000/60)) + ' Minutes.')
            Writeln('Gained exp: ' + ToStr(xp))
            Writeln('Exp per hour: ' + ToStr(Round(3600*(xp)/(ms/1000))));
            Writeln('Runs: ' + ToStr(theives))
            Writeln('Runs per hour: ' + ToStr(Round(3600*(theives)/(ms/1000))));
            Writeln('Gained coins: ' + ToStr(coins))
            Writeln('Coins per hour: ' + ToStr(Round(3600*(coins)/(ms/1000))));
            if (BRAWLERS=('yes')) then
              begin
                Writeln('Brawlers used:' + Tostr(brawler))
              end;
            Writeln('--------------------------------------------------')
          end;
        if (ms = 0) then
          begin
            Writeln('--------------------------------------------------')
            Writeln('----------Dinosaurrr Soulsplit Theiving-----------')
            Writeln('-------Please give paint a momment to begin.------')
            Writeln('--------------------------------------------------')
          end;
      end;
    
    begin
      xp:=0;
      theives:=0;
      mode:= 208;
      coins:=0;
      gaingp:=30313;
        repeat
          CheckBrawlers;
          Theive;
          ClearDebug;
          Paint;
        until(false);
    end.
    I for some strange reason didn't think code tags put stuff in boxes with scroll bars. I thought it was gonna span the whole page >_>
    Last edited by Dinosaurrr; 12-06-2012 at 05:43 PM.

  14. #14
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    fixed your standards a bit. try this then.
    also next time use SIMBA tags instead of CODE
    Simba Code:
    program FishTheiver;
    var
      x, y: Integer;
      c, d: Integer;
      xp: Integer;
      theives: Integer;
      mode: Integer;
      ms: Integer;
      brawler: Integer;
      coins: Integer;
      gaingp: Integer;

    const
      BRAWLERCOLOR = 602420; //602420 brown, 6439284 purple.
      BORDERWIDTH = 16; //Black border around game.
      BRAWLERS = 'No'; //Use brawlers? 'Yes' or 'No'

    procedure CheckBrawlers;
    begin
      if (BRAWLERS = 'Yes') then
      begin
        if FindColorTolerance(x, y, BRAWLERCOLOR, 568+(BORDERWIDTH), 371, 599+(BORDERWIDTH), 396, 10 ) = false then
        begin
          PressKey(112);
          repeat
            Wait(50);
          until(FindColorTolerance(x, y, 1482692, 550+(BORDERWIDTH), 205, 735+(BORDERWIDTH), 461, 10) = true);
          if FindColorTolerance(x, y, BRAWLERCOLOR, 550+(BORDERWIDTH), 205, 735+(BORDERWIDTH), 461, 10) = true then
          begin
            MoveMouse(x, y);
            repeat
              wait(100);
            until(FindColorTolerance(c, d, 3768029, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 30) = true);
            ClickMouse(x, y, 1);
            repeat
              wait(50);
            until(FindColorTolerance(c, d, 3768029, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 30) = false);
            PressKey(113);
            repeat
              wait(50);
            until(FindColorTolerance(x, y, BRAWLERCOLOR, 570+(BORDERWIDTH), 368, 602+(BORDERWIDTH), 400, 10) = true);
            IncEx(brawler, 1);
          end;
        end;
      end;
    end;


    procedure Theive;
    begin
      if FindColorTolerance(x, y, 9611960, 0, 0, 513+(BORDERWIDTH), 332, 5) = true then
      begin
        MoveMouse(x, y);
        wait(100);
        if (FindColorTolerance(c, d, 15724822, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 40) = true) then
        begin
          ClickMouse(x, y, 1);
          repeat
            wait(50);
          until(FindColorTolerance(c, d, 15724822, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 40) = false);
          IncEx(xp, mode);
          IncEx(theives, 1);
          IncEx(coins, gaingp);
          wait(500);
        end;
      end;
    end;

    procedure Paint;
    var
      cph, rph, xph: extended;
    begin
      ms:= GetTimeRunning;
      if ms < 1 then exit;
      cph := 3600*(coins)/(ms/1000);
      rph := 3600*(theives)/(ms/1000);
      xph := 3600*(xp)/(ms/1000);
      if (ms > 0) then
      begin
        Writeln('--------------------------------------------------')
        Writeln('----------Dinosaurrr Soulsplit Theiving-----------')
        Writeln('Time ran: ' + ToStr(Round(ms/1000/60)) + ' Minutes.')
        Writeln('Gained exp: ' + ToStr(xp))
        Writeln('Exp per hour: ' + ToStr(xph));
        Writeln('Runs: ' + ToStr(theives))
        Writeln('Runs per hour: ' + ToStr(rph));
        Writeln('Gained coins: ' + ToStr(coins))
        Writeln('Coins per hour: ' + ToStr(cph));
        if (BRAWLERS=('yes')) then
        begin
          Writeln('Brawlers used:' + Tostr(brawler))
        end;
        Writeln('--------------------------------------------------')
      end;
      if (ms = 0) then
      begin
        Writeln('--------------------------------------------------')
        Writeln('----------Dinosaurrr Soulsplit Theiving-----------')
        Writeln('-------Please give paint a momment to begin.------')
        Writeln('--------------------------------------------------')
      end;
    end;

    begin
      xp:=0;
      theives:=0;
      mode:= 208;
      coins:=0;
      gaingp:=30313;
      repeat
        CheckBrawlers;
        Theive;
        ClearDebug;
        Paint;
      until(false);
    end.
    Last edited by footballjds; 12-06-2012 at 06:49 PM.

  15. #15
    Join Date
    Nov 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you so much it works If you're ever on soulsplit add me 4 r's till I get banned haha :P

    Sometimes has divided by 0 errors but I'll figure that out thanks
    Last edited by Dinosaurrr; 12-06-2012 at 08:53 PM.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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