Results 1 to 21 of 21

Thread: Only once?

  1. #1
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Only once?

    just wondering if i wanted something to only do something once how would i do it? could i make an integer and do this for example?

    SCAR Code:
    If End >= 1 then
    begin
    *rest of stuff here*

    but i would also want it to do one thing only once before it does the above so could i do:

    SCAR Code:
    if End >= 0 then
    begin
    *stuff here*

    would that work? also if it would how would i stop end counting over 1? because when it reached 2 would it start doing the first one again? or is there a way to say for example make it do:

    SCAR Code:
    if End >= 1 or more....
    begin
    *stuff*

    - Thanks

  2. #2
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure go;
    begin
      if(a=1)then Exit;
      dothis;
      dothat;
      a:=1;
    end;

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  3. #3
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ah ok so when it does that and
    Code:
    a:=1;
    accurs it will just skip over it next time because a = 1?

    Thanks

    p.s : that was an amazingly fast response lol

  4. #4
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea you set A:=1 after you have completed what you want to do once.

    You could do it the other way around

    SCAR Code:
    Procedure go;
    Begin
      If (a = 0) Then
      Begin
        dothis;
        dothat;
        a := 1;
      End;
    End;

    Whichever way you want lol. If you want it to do something if its 1 then better to do it that way using an End Else, but if its just dont do anything if its 1 then just use Exit; and it will exit the procedure

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  5. #5
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    You could always make a procedure and just call it up once O.o

  6. #6
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    but if it was for example..

    SCAR Code:
    procedure go;
    begin
     if(a=1)then Exit;
    dothis;  
    dothat;  
    a:=1;
    end;
    if(a=1)then // but i would only want it to do this on its 2nd loop
    begin
    stuff;
    stuff;
    end;

    how would i do that? to explain more... say i wanted on the first trip to the bank to withdraw 4000 coins by clicking withdraw x.. but every trip after i would want it to choose the option 'Withdraw 4000' from the options list. how would i get it to do that?

    EDIT: i just had a brainwave would this work?

    SCAR Code:
    procedure go;
    begin
     if(a=1)then Exit;
    dothis;  
    dothat;  
    a:=1;
    b:=1; // make b = 1 here
    end;
    if(b=2)then // so it skips this because b, currently is only =1
    begin
    stuff;
    stuff;
    end;

    but then further on in another procedure i do
    SCAR Code:
    b:=2;

    thus making the if(b=2)then work

    is that a good idea?
    Last edited by pl0xmypl0x; 08-30-2009 at 10:57 AM.

  7. #7
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Var
     A: Integer;

    Procedure WithDrawCash;
    Begin
      //WithDrawStuff Here
      A := 1;
    End;

    Procedure go;
    Begin
      If (A = 0) Then WithDrawCash;
      If (A = 1) Then WithDrawX;
    End;

    or..

    SCAR Code:
    Var
     A: Integer;

    Procedure WithDrawCash;
    Begin
      //WithDrawStuff Here
      A := 1;
    End;

    Procedure WithDrawX;
    Begin
      //WithDrawX
    End;

    Procedure WithDraw;
    Begin
      Case A Of
       0: WithDrawCash;
       1: WithDrawX
      End;
    End;

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  8. #8
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Would the idea that i posted after the EDIT: above work?

  9. #9
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea but just use
    SCAR Code:
    If (A=1)Then

    Use this

    SCAR Code:
    Procedure WithDraw;
    Begin
      If (ChooseOption('ithdraw 4000')) Then
      Begin
        Writeln('All good, we withdrawed 4000 coins');  
      End Else
      Begin
        If (ChooseOption('draw-X')) Then
        Begin
          Writeln('Withdraw 4000 was not present so we are withdrawing it manually');
          Withdraw(0, 0, 4000); //Coins in First slot in bank
        End Else
        Begin
          Writeln('Oh shit. Something is wrong cant find Withdraw 4000 or Withdraw-X');
          TerminateScript;
        End;
      End;
    End;

    Youll have to test it tho, not sure if it will work like that, not sure about the
    SCAR Code:
    If (ChooseOption('ithdraw 4000')) Then

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  10. #10
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    procedure go;
    begin
     if(a=1)then Exit;
    dothis;
    dothat;
    a:=1;
    end;
    if(a=1)then // but i would only want it to do this on its 2nd loop
    begin
    stuff;
    stuff;
    end;

    What you have there isn't going to do it, because the first time, it will do what you want to have done twice, and then the second time it will exit and not do either.

    The way I would do it is:

    SCAR Code:
    var
      a: integer;

    procedure dosecondtime;
    begin
      if (a <> 1) then Exit;
      if (a = 1) then
      blah blah...
    end;

    procedure go;
    begin
      dosecondtime;
      if (a < 1) then
      a := 1;
      blah blah...
    end;

    This way it will exit out of the "real" loop if it hasn't done it once before.

    EDIT: damn too slow :O
    Last edited by Runaway; 08-30-2009 at 11:06 AM.

  11. #11
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i cant because i need it to skip the 2nd one, until it returns to the bank on its second run other wise it would withdraw 2x the amount of cash needed

    Thanks for the help everyone it has been of great use

    @runawaycop : You must have missed my edit on that post thanks for the help tho
    Last edited by pl0xmypl0x; 08-30-2009 at 11:01 PM.

  12. #12
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Procedure WithDraw;
    Begin
      If (ChooseOption('ithdraw-4000')) Then
      Begin
        Writeln('All good, we withdrawed 4000 coins');  
      End Else
      Begin
        If (ChooseOption('draw-X')) Then
        Begin
          Writeln('Withdraw 4000 was not present so we are withdrawing it manually');
          Withdraw(0, 0, 4000); //Coins in First slot in bank
        End Else
        Begin
          Writeln('Oh shit. Something is wrong cant find Withdraw 4000 or Withdraw-X');
          TerminateScript;
        End;
      End;
    End;


    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  13. #13
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oo i like the look of that Thanks

  14. #14
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Recheck the post it should be

    SCAR Code:
    If (ChooseOption('ithdraw-4000')) Then

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  15. #15
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Just to check, my method would work also, right?

  16. #16
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    If you don't want to force the user to place coins in first spot you can always simply use a DTM, if the script cant find the DTM on the first page make a function to click the search button and type in the item name, find the DTM, and withdraw than, because that's how a real human would do it, and we seek as much realism as possible in scripts to prevent possible bans.

    You could also use color spiral as I believe you would have to have 3 different DTMs, as the coin sprite changes a few times.
    Last edited by Feroc1ty; 08-30-2009 at 11:16 AM.

  17. #17
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Human like is exactly what he is doing. When i login ill do withdraw X, but then when i re-bank i wont do X ill just click what i did before. Eg cooking always withdrawing 26. Etc

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  18. #18
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post
    Human like is exactly what he is doing. When i login ill do withdraw X, but then when i re-bank i wont do X ill just click what i did before. Eg cooking always withdrawing 26. Etc
    And you always place the thing you're doing in first slot? Because I personally don't, as my brain memory isn't that limited, and going to the very first slot is slower than almost any other bank slot, as it's at top left of screen.

  19. #19
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Feroc1ty View Post
    And you always place the thing you're doing in first slot? Because I personally don't, as my brain memory isn't that limited, and going to the very first slot is slower than almost any other bank slot, as it's at top left of screen.
    Who said anything about it going in the same slot everytime? it can be anywhere in the bank and my functions can still find the logs...

  20. #20
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by pl0xmypl0x View Post
    Who said anything about it going in the same slot everytime? it can be anywhere in the bank and my functions can still find the logs...
    The above snippet of code makes use of only the first slot.

  21. #21
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Feroc1ty View Post
    The above snippet of code makes use of only the first slot.
    The above snippet is for example purposes only.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

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
  •