Results 1 to 6 of 6

Thread: looping a script?

  1. #1
    Join Date
    Mar 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default looping a script?

    I'm currently running GrahamFisherv1.0 and it runs great, but idk how to make the script loop upon successful completion. What code do I need to add and where should I place it?

    This is the current Code:

    program Fisher;
    {$I SRL/SRL.Simba}
    {$I P07Include.Simba}
    {$i sps/sps.simba}
    var
    CHANGE_COUNT, b, b1, b2, b2one, b3, b3one, b3two, b4, b5, b6: integer;



    Procedure AntiBan;
    begin
    case(random(250)) of
    0: MMouse(random(500), random(500), 1, 2);
    10: P07_HoverSkill('Fishing',1000+Random(4000));
    20: P07_HoverSkill('Fishing',1000+Random(4000));
    30: P07_MakeCameraAngleHigh;
    40: P07_MakeCameraAngleLow;
    50: P07_MakeCompassDegree(random(360));
    end;
    end;

    procedure FindRod;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['rod'],[1208726,1141389],5) Then
    begin
    ClickMouse2(mouse_left);
    wait(1250+random(200))
    end;
    end;

    procedure ClickGenie;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['enie'],[5704020, 4786501, 9376393, 8719998, 4390976],10) Then
    begin
    ClickMouse2(mouse_left);
    wait(1500+random(100))
    P07_ClickToContinue;
    wait(1000+random(100))
    If P07_FindObjCustom(x,y,['enie'],[1650385],10) Then
    repeat
    wait(random(1000));
    until not(P07_FindObjCustom(x,y,['enie'],[1650385],10))
    end;
    end;

    procedure ClickMan;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['ious','alk'],[5849352],10) Then
    begin
    ClickMouse2(mouse_left);
    wait(1500+random(100))
    P07_ClickToContinue;
    wait(1000+random(100))
    If P07_FindObjCustom(x,y,['ious','alk'],[5849352],10) Then
    repeat
    wait(random(1000));
    until not(P07_FindObjCustom(x,y,['ious','alk'],[5849352],10))
    end;
    end;

    procedure RunSwarm;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['alk','ere'],[255],10) Then
    begin
    wait(8000+random(500))
    If P07_FindObjCustom(x,y,['alk','ere'],[255],10) Then
    begin
    If P07_FindObjCustom(x,y,['alk','ere'],[3179891],10) Then
    begin
    ClickMouse2(mouse_left);
    wait(3000+random(1000))
    end;
    end;
    end;
    end;

    procedure ClickJekyll;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['yll'],[594262],10) Then
    begin
    ClickMouse2(mouse_left);
    wait(1500+random(100))
    P07_ClickToContinue;
    wait(1000+random(100))
    If P07_FindObjCustom(x,y,['yll'],[594262],10) Then
    repeat
    wait(random(1000));
    until not(P07_FindObjCustom(x,y,['ekyll'],[594262],10))
    end;
    end;

    procedure ClickFruit;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['ick','ruit'],[12479637],10) Then
    begin
    wait(5000+random(1000))
    ClickMouse2(mouse_left);
    If P07_FindObjCustom(x,y,['ick','ruit'],[12479637],10) Then
    repeat
    wait(random(1000));
    until not(P07_FindObjCustom(x,y,['ick','ruit'],[12479637],10))
    end;
    end;

    procedure ClickDwarf;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['warf'],[1844602],10) Then
    begin
    ClickMouse2(mouse_left);
    wait(2000+random(1000))
    P07_ClickToContinue;
    wait(500+random(100))
    If P07_FindObjCustom(x,y,['warf'],[1844602],10) Then
    repeat
    wait(random(1000));
    until not(P07_FindObjCustom(x,y,['warf'],[1844602],10))
    end;
    end;

    procedure ClickHand;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['and'],[3549040],10) Then
    begin
    ClickMouse2(mouse_left);
    wait(1500+random(100))
    P07_ClickToContinue;
    wait(1000+random(100))
    If P07_FindObjCustom(x,y,['and'],[3549040],10) Then
    repeat
    wait(random(1000));
    until not(P07_FindObjCustom(x,y,['and'],[3549040],10))
    end;
    end;

    procedure ClickRick;
    var
    x, y:integer;
    begin
    If P07_FindObjCustom(x,y,['tine','ick'],[7748225,7354492],10) Then
    begin
    ClickMouse2(mouse_left);
    wait(1500+random(100))
    P07_ClickToContinue;
    wait(1000+random(100))
    If P07_FindObjCustom(x,y,['tine','ick'],[7748225,7354492],10) Then
    repeat
    wait(random(1000));
    until not(P07_FindObjCustom(x,y,['tine','ick'],[7748225,7354492],10))
    end;
    end;

    Function IsFishing1: Boolean;
    var
    i, i2: integer;
    begin
    i := P07_InvCount;
    wait(8000 + random(100));
    i2 := p07_InvCount;
    AntiBan;
    if (i2 > i) then
    begin
    result:=true
    writeln('we are fishing');
    end else
    begin
    result:= false;
    writeln('not currently fishing');
    end;
    end;

    //if at top spot returns 1 and bottom returns two
    Function CheckSpot: Integer;
    var
    x, y, FishDTM: integer;
    begin
    P07_MakeCompassNorth;
    wait(500);
    FishDTM:= DTMFromString('mQwAAAHicY2ZgYKhiYmCoBeI6IA4D8sOBOA SIpQOfMAhrnmdQavjPgAwYkTAQAAALiAZ/');
    if findDTM(FishDTM, x, y, 550,1, 727, 61) then
    begin
    result:= 2;
    writeln('Fishing at bottom location');
    end else
    begin
    result:= 1;
    writeln('Fishing at top location');
    end;
    FreeDTM(FishDTM);
    end;

    Procedure changeSpot;
    var
    x, y, FishDTM: integer;
    begin
    FishDTM:= DTMFromString('mQwAAAHicY2ZgYKhiYmCoBeI6IA4D8sOBOA SIpQOfMAhrnmdQavjPgAwYkTAQAAALiAZ/');
    if (Checkspot = 1) then
    begin
    if (FindDTM(FishDTM, x, y, 530, 100, 695, 151)) then
    begin
    mouse(x, y, 1, 1, 1);
    writeln('moving to bottom location');
    wait(3000 + random(100));
    end;
    end;
    if (Checkspot = 2) then
    begin
    if (FindDTM(FishDTM, x, y, 550,1, 727, 61)) then
    begin
    mouse(x, y, 1, 1, 1);
    writeln('moving to top location');
    wait(3000 + random(100));
    end;
    end;
    FreeDTM(FishDTM);
    end;

    procedure Fish;
    var
    x, y: integer;
    begin
    if (P07_FindObjCustom(x, y, ['ure', 'ishin', 'ot'], [14597535, 15123609, 14794914, 14858129, 13216647, 14597268, 15123625, 14398100, 14729121], 3) ) then
    begin
    mouse(x,y,1,1,1)
    wait(1000 + random(50));
    end else
    begin
    changeSpot;
    end;
    end;

    Procedure Bank;
    var
    x, y,salmon, trout: integer;
    begin
    salmon := DTMFromString('mlwAAAHicY2dgYOBhZmDgA2IRZghbAIjZoP gJIwPDcyB+DMSvGCH8d1B2baAHw87yLIaNhWkMB6pzGRZmxDAc XbmMYeesKQz4ACMeDAUASDwSFQ==');
    trout := DTMFromString('m1gAAAHic42JgYOBlZmDggWJOIGYGYgEgFg ZicSDmB2J2INZiYmDQBWJDIDaFYn0g1gZiNSA2guLs5GSGCW1t DMf27mU4vGsnw/VLFxmO7NnNsGzWTIYZvT0Md65fZzhz9AgDsYCRSIwAAGGDFv8= ');
    if (not P07_BankScreen) then
    begin
    writeln('bank not open');
    if P07_FindObjCustom(x, y, ['ank', 'ooth'], [609382, 607580, 3239562, 2843002, 2974589, 608609], 5) then
    begin
    case random(4) of
    0..2:
    begin
    mouse(x, y, 1, 1, 1);
    wait(randomrange(2000, 2500));
    end;
    3:
    begin
    MMouse(x, y, 1, 1);
    wait(randomrange(75, 150));
    ClickMouse2(mouse_right);
    wait(randomrange(75,150));
    P07_ChooseOptionMulti(['k B', 'ooth', 'ank']);
    wait(randomrange(2000, 2500));
    end;
    end;
    end;
    end;
    if (P07_InvCount > 3) then
    begin
    if (findDTM(salmon, x, y, P07_MIX1, P07_MIY1, P07_MIX2, P07_MIY2)) then
    begin
    MMouse(x, y, 1, 1);
    wait(randomrange(75, 150));
    ClickMouse2(Mouse_Right);
    wait(randomrange(75, 150));
    P07_ChooseOptionMulti(['ank', 'll', 'all']);
    wait(randomrange(75,150));
    end;
    if (findDTM(trout, x, y, P07_MIX1, P07_MIY1, P07_MIX2, P07_MIY2)) then
    begin
    MMouse(x, y, 1, 1);
    wait(randomrange(75, 150));
    ClickMouse2(Mouse_Right);
    wait(randomrange(75, 150));
    P07_ChooseOptionMulti(['ank', 'll', 'all']);
    wait(randomrange(75,150));
    end;
    end;
    FreeDTM(salmon);
    FreeDTM(trout);
    end;

    Procedure Drop;
    var
    i: integer;
    begin
    repeat

    for i:= 3 to 28 do
    begin
    if (P07_ItemExists(i)) then
    begin
    P07_DropInventorySlot(i);
    Wait(randomRange(50, 75));
    end;
    end;
    until(P07_InvCount < 3);
    end;

    begin
    SetupP07Include;
    activateclient;
    CHANGE_COUNT:= 0;
    wait(500);
    repeat
    repeat
    if (not isfishing1) then
    begin
    if (Not P07_ItemExists(2)) then
    FindRod;
    ClickGenie;
    ClickMan;
    RunSwarm;
    ClickJekyll;
    ClickFruit;
    ClickDwarf;
    ClickHand;
    ClickRick;
    Fish;
    end;
    until(P07_InvFull);
    Drop;
    until(IskeyDown(VK_ENTER));
    end.

  2. #2
    Join Date
    Mar 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    is it banking or dropping? Because from the way i can understand it, it's telling rs to fish untill the inventory is full, then drop everything except the first two inventory slots, then it finishes executing the script.. If you wanted to to loop the whole fishing and dropping situation, you would need to tell it to loop those procedures until false (I think?)

  3. #3
    Join Date
    Mar 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    There is no banking involving or desired on my end. How would I tell it to loop the procedures until false? Do you know how the script would look upon completion?

  4. #4
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    Both of your threads are in the wrong place, this is the correct place:
    http://villavu.com/forum/forumdisplay.php?f=491

    however don't make another thread..
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  5. #5
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Simba Code:
    begin
      SetupP07Include;
      activateclient;
      CHANGE_COUNT:= 0;
      wait(500);
      repeat
        repeat
          if (not isfishing1) then
          begin
            if (Not P07_ItemExists(2)) then
            FindRod;
            ClickGenie;
            ClickMan;
            RunSwarm;
            ClickJekyll;
            ClickFruit;
            ClickDwarf;
            ClickHand;
            ClickRick;
            Fish;
          end;
        until(P07_InvFull);
        Drop;
      until false;
    end.

    Is that what you want?

  6. #6
    Join Date
    Mar 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Edit: Resolved. Thank you all for your help and sorry for posting in the incorrect areas.
    Last edited by cento330; 03-26-2013 at 03:20 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
  •