Results 1 to 22 of 22

Thread: test/ scripting help

  1. #1
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default test/ scripting help

    i got the feelling this is working, i know you guys dont like to test please do it
    this should logout when it cant find one of the rune dtm's in inventory
    but i dont know its working i got the feeling it dont pls test!

    SCAR Code:
    program New;
    {.include srl/srl.scar}

    var
      x, y: integer;
      StartSkill, EndSkill: integer;
      WaterRune, EarthRune, BodyRune: integer;

    const
    ////////////////////////////
      CompassDirection = 'E'; // If your at the monk of zamorak then let this, else change!
      Color0 = 8103122;       // If your at the monk of zamorak then let this, else change!
      Color1 = 3883688;       // If your at the monk of zamorak then let this, else change!
      Color2 = 6918074;       // If your at the monk of zamorak then let this, else change!
      UpText1 = 'onk';        // If your at the monk of zamorak then let this, else change!
      UpText2 = 'of';         // If your at the monk of zamorak then let this, else change!
      UpText3 = 'amorak';     // If your at the monk of zamorak then let this, else change!
      Tolerance = 25;         // Let this!
    ////////////////////////////


    function FindRune(DTM: string): boolean;
    begin
      GameTab(4);
      if (DTM = 'Water Rune') then
      begin
        WaterRune := DTMFromString('78DA63CC656660E8636440062252CB1924813' +
          '448F43F1030C603D5B4A3AA81C8C248209D0A54339D809A02A09A' +
          '9904D45402D54C26A0A61AA8A69B0873DAF0AB01001E4B0C12');
        if (FindDTM(WaterRune, x, y, MIX1, MIY1, MIX2, MIY2)) then
        begin
          writeln('Found Water Rune');
        end else
          writeln('Did NOT Found Water Rune');
        LogOut;
      end else
        if (DTM = 'Earth Rune') then
        begin
          EarthRune := DTMFromString('78DA639CCECCC0D0C5C8800C723C781924813' +
            '448F43F10307601D54C405503918591407A2250CD0C026AE611A1' +
            '6629504D3701354B806A261250D30954D3895F0D00B54F0D18');
          if (FindDTM(EarthRune, x, y, MIX1, MIY1, MIX2, MIY2)) then
          begin
            writeln('Found Earth Rune');
          end else
            writeln('Did NOT Found Earth Rune');
          LogOut;
        end else
          if (DTM = 'Body Rune') then
          begin
            BodyRune := DTMFromString('78DA637461666098C8C8800C4404051924813' +
              '448F43F10309A02D5F4A0AA81C8C248206D0E543389801A5BA09A' +
              '1904D4B803D5CC24A0C61FA8663201358144B819644E1B0135664' +
              '035ADF8D5000022460BED');
            if (FindDTM(BodyRune, x, y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              writeln('Found Body Rune');
            end else
              writeln('Did NOT Found Body Rune');
            LogOut;
          end;
    end;


    function GetLevel(Skill: string; Option: boolean): integer;
    begin
      if not LoggedIn then Exit;
      if (Option = True) then
      begin
        GameTab(2);
        StartSkill := GetSkillLevel(Skill);
      end else
      begin
        GameTab(2);
        EndSkill := GetSkillLevel(Skill);
      end;
    end;



    procedure CheckEquipMent;
    begin
      if (Players[CurrentPlayer].Booleans[0] = true) then
      begin
        if (Players[CurrentPlayer].Strings[0] = 'Earth') then
        begin
          FindRune('Body Rune');
          FindRune('Water Rune');
        end else
          if (Players[CurrentPlayer].Strings[0] = 'Water') then
          begin
            FindRune('Body Rune');
            FindRune('Earth Rune');
          end;
      end else
        if (Players[CurrentPlayer].Booleans[0] = False) then
        begin
          FindRune('Body Rune');
          FindRune('Earth Rune');
          FindRune('Water Rune');
        end;
    end;




    procedure Proggy;
    begin
      WriteLn('//////////////////////////////////////////////////////');
      WriteLn('//         Thanks for using my Auto-Curser.         //');
      WriteLn('//             post Proggy,s and bugs.              //');
      WriteLn('//////////////////////////////////////////////////////');
      WriteLn('// Ran for ' + (timerunning) + '//');
      WriteLn('// You started with Magic level : ' + inttostr(StartSkill) + '');
      WriteLn('// You Magic level is now  : ' + inttostr(EndSkill) + '');
      WriteLn('//////////////////////////////////////////////////////////////');
    end;


    procedure SetUpClient;
    begin
      Wait(1000);
      SRLPlayerForm(True, ['Use staff?'], ['How many casts?'], ['earth/water staff? (when using one)'], []); // Thanks! Summilion
      Wait(100);
      LoginPLayer;
      MakeCompass(CompassDirection);
      HighestAngle;
      GetLevel('magic', True);
      GameTab(4);
    end;


    {===================]
          MainLoop
    [===================}

    begin
      SetUpSrl;
      SetUpClient;
      CheckEquipMent;
    end.

    pls test! thanks,

    Hermpie

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

    Default

    SCAR Code:
    if (FindDTM(BodyRune, x, y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              writeln('Found Body Rune');
            end else
              writeln('Did NOT Found Body Rune');
            LogOut;
          end;

    Needs to be..

    SCAR Code:
    end else
    begin
      writeln('Did NOT Found Body Rune');
      LogOut;
    end;
    end;

    Else it would logout if u found it. Come on now being SRL member

    Also, instead of doing

    SCAR Code:
    if (DTM = 'Water Rune') then

    Why not do a case?

    SCAR Code:
    case DTM of
    'Water rune' : DTM:= DTMFromString('78DA63CC656660E8636440062252CB1924813' +
          '448F43F1030C603D5B4A3AA81C8C248209D0A54339D809A02A09A' +
          '9904D45402D54C26A0A61AA8A69B0873DAF0AB01001E4B0C12');
    'body rune' : DTM:=DTMFromString('insert your stuff here cause i cant be bothered...');
    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
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm going to look tomorrow, I think I have some suggestions, I'm running VM for first time atm, it's wierd

    -Tsn.
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  4. #4
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the point it it does nothing it doesnt write anything in the debug and doesnt logout :S

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

    Default

    Nvm

    Do you even have the DeclarePlayers in there? (not used SRLPlayerForm before..)

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

  6. #6
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ehm... dude about i could use case of dtm but then i have some probs with other stuff this time and if then statement is better
    but still thanks

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

    Default

    Where are you suppose to put in Earth, Water etc in the form? Its all blank...

    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
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ehm its a curser you need all of those with all the curses

    msn?
    kotsz@live.nl

    hermpie

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

    Default

    SCAR Code:
    SRL Compiled in 16 msec
    Found Earth Rune
    Did NOT Found Body Rune

    Works for me

    You have to add the begin and end's to the else otherwise it logout when u have all the runes..

    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
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    strange..
    send me your version did you only add begins and ends?

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

    Default

    Yeap only the begins and ends.

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

  12. #12
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    pls send, its just not working maybe its my srl?

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

    Default

    Missing Rune Water
    Found Rune Earth
    Missing Rune Body
    Didnt have the needed runes. Logging out
    Finding runes took 125 Msec
    Altered mine for a moment lol. I only ran the FindRune for each of the runes and it worked. I didnt run the other stuff.

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

  14. #14
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    cmon just give it doesnt work for me it says:
    SCAR Code:
    Successfully compiled
    Line 22: [Hint] (14716:10): Variable 'Result' never used in script H:\Documents and Settings\Hermen\Bureaublad\mijn scripts\Hermpie's Auto Curser.scar
    Line 68: [Hint] (14762:10): Variable '
    Result' never used in script H:\Documents and Settings\Hermen\Bureaublad\mijn scripts\Hermpie's Auto Curser.scar
    SRL Compiled in 16 msec
    Successfully executed

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

    Default

    Using this as mainloop (no other edits)

    SCAR Code:
    begin
      SetUpSrl;
      ActivateClient;
      wait(500);
          FindRune('Body Rune');
          FindRune('Earth Rune');
          FindRune('Water Rune');
    end.

    I get..
    SRL Compiled in 16 msec
    Did NOT Found Body Rune
    Successfully executed
    ovbiously it checks for body first, doesn't find and logs out. Correct.

    But with earth checking first. it finds it but logs out. (Due to incorrect begin and end's on end else)

    SRL Compiled in 16 msec
    Found Earth Rune
    Successfully executed

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

  16. #16
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    but what wrong then with my equip procedure?

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

    Default

    Looks like several problems.

    1:
    You dont enter anything into the form and leave it as True it will do nothing. (just runs and exit's);

    2:
    Your begin and end's are pretty much messed with the end else's which causes them to logout if u have them and also doesn't make the if statements work.

    SCAR Code:
    program New;
    {.include srl/srl.scar}

    var
      x, y: integer;
      StartSkill, EndSkill: integer;
      WaterRune, EarthRune, BodyRune: integer;

    const
    ////////////////////////////
      CompassDirection = 'E'; // If your at the monk of zamorak then let this, else change!
      Color0 = 8103122;       // If your at the monk of zamorak then let this, else change!
      Color1 = 3883688;       // If your at the monk of zamorak then let this, else change!
      Color2 = 6918074;       // If your at the monk of zamorak then let this, else change!
      UpText1 = 'onk';        // If your at the monk of zamorak then let this, else change!
      UpText2 = 'of';         // If your at the monk of zamorak then let this, else change!
      UpText3 = 'amorak';     // If your at the monk of zamorak then let this, else change!
      Tolerance = 25;         // Let this!
    ////////////////////////////


    function FindRune(DTM: string): boolean;
    begin
      GameTab(4);
      if (DTM = 'Water Rune') then
      begin
        WaterRune := DTMFromString('78DA63CC656660E8636440062252CB1924813' +
          '448F43F1030C603D5B4A3AA81C8C248209D0A54339D809A02A09A' +
          '9904D45402D54C26A0A61AA8A69B0873DAF0AB01001E4B0C12');
        if (FindDTM(WaterRune, x, y, MIX1, MIY1, MIX2, MIY2)) then
        begin
          writeln('Found Water Rune');
        end else
        begin
          writeln('Did NOT Found Water Rune');
        LogOut;
        end;
      end;
        if (DTM = 'Earth Rune') then
        begin
          EarthRune := DTMFromString('78DA639CCECCC0D0C5C8800C723C781924813' +
            '448F43F10307601D54C405503918591407A2250CD0C026AE611A1' +
            '6629504D3701354B806A261250D30954D3895F0D00B54F0D18');
          if (FindDTM(EarthRune, x, y, MIX1, MIY1, MIX2, MIY2)) then
          begin
            writeln('Found Earth Rune');
          end else
          begin
            writeln('Did NOT Found Earth Rune');
          LogOut;
          end;
        end;
          if (DTM = 'Body Rune') then
          begin
            BodyRune := DTMFromString('78DA637461666098C8C8800C4404051924813' +
              '448F43F10309A02D5F4A0AA81C8C248206D0E543389801A5BA09A' +
              '1904D4B803D5CC24A0C61FA8663201358144B819644E1B0135664' +
              '035ADF8D5000022460BED');
            if (FindDTM(BodyRune, x, y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              writeln('Found Body Rune');
            end else
            begin
              writeln('Did NOT Found Body Rune');
            LogOut;
            end;
          end;
    end;


    function GetLevel(Skill: string; Option: boolean): integer;
    begin
      if not LoggedIn then Exit;
      if (Option = True) then
      begin
        GameTab(2);
        StartSkill := GetSkillLevel(Skill);
      end else
      begin
        GameTab(2);
        EndSkill := GetSkillLevel(Skill);
      end;
    end;



    procedure CheckEquipMent;
    begin
      if (Players[CurrentPlayer].Booleans[0] = true) then
      begin
        if (Players[CurrentPlayer].Strings[0] = 'Earth') then
        begin
          FindRune('Body Rune');
          FindRune('Water Rune');
        end else
        begin
          if (Players[CurrentPlayer].Strings[0] = 'Water') then
          begin
            FindRune('Body Rune');
            FindRune('Earth Rune');
          end;
        end;
      end;
      if (Players[CurrentPlayer].Booleans[0] = False) then
      begin
        FindRune('Body Rune');
        FindRune('Earth Rune');
        FindRune('Water Rune');
      end;
    end;




    procedure Proggy;
    begin
      WriteLn('//////////////////////////////////////////////////////');
      WriteLn('//         Thanks for using my Auto-Curser.         //');
      WriteLn('//             post Proggy,s and bugs.              //');
      WriteLn('//////////////////////////////////////////////////////');
      WriteLn('// Ran for ' + (timerunning) + '//');
      WriteLn('// You started with Magic level : ' + inttostr(StartSkill) + '');
      WriteLn('// You Magic level is now  : ' + inttostr(EndSkill) + '');
      WriteLn('//////////////////////////////////////////////////////////////');
    end;


    procedure SetUpClient;
    begin
      SRLPlayerForm(True, ['Use staff?'], ['How many casts?'], ['earth/water staff? (when using one)'], []); // Thanks! Summilion
      //MakeCompass(CompassDirection);
      HighestAngle;
      //GetLevel('magic', True);
      GameTab(4);
    end;


    {===================]
          MainLoop
    [===================}

    begin
      SetUpSrl;
      SetupClient;
      ActivateClient;
      wait(500);
      CheckEquipMent;
    end.

    Thats what the script i just ran and it semi worked (logged out) cause i didnt have rune.

    This is what i come up with for the FindRunes

    SCAR Code:
    function FindRunes: boolean;
    var
    i,dtm,temp:integer;
    rune:string;
    foundrune:array[1..3] of boolean;
    begin
      marktime(temp);
      GameTab(4);
      for i:=1 to 3 do
      begin
        case i of
        //Water Rune
        1: begin
             DTM:= DTMFromString('78DA63CC656660E8636440062252CB1924813' +
            '448F43F1030C603D5B4A3AA81C8C248209D0A54339D809A02A09A' +
            '9904D45402D54C26A0A61AA8A69B0873DAF0AB01001E4B0C12');
             Rune:='Water';
           end;
        //Earth Rune
        2: begin
             DTM:= DTMFromString('78DA639CCECCC0D0C5C8800C723C781924813' +
                '448F43F10307601D54C405503918591407A2250CD0C026AE611A1' +
                '6629504D3701354B806A261250D30954D3895F0D00B54F0D18');
             Rune:='Earth';
           end;
        //Body Rune
        3: begin
             DTM:= DTMFromString('78DA637461666098C8C8800C4404051924813' +
                  '448F43F10309A02D5F4A0AA81C8C248206D0E543389801A5BA09A' +
                  '1904D4B803D5CC24A0C61FA8663201358144B819644E1B0135664' +
                  '035ADF8D5000022460BED');
             Rune:='Body';
           end;
        end;
        if(FindDTM(DTM,x,y,MIX1,MIY1,MIX2,MIY2))then
        begin
          FoundRune[i]:=True;
          writeln('Found Rune '+Rune);
        end else
        begin
          writeln('Missing Rune '+Rune);
        end;
      end;
        if(Not FoundRune[1]) or (Not FoundRune[2]) or (Not FoundRune[3])then
        begin
          writeln('Didnt have the needed runes. Logging out');
          //Logout;
        end;
      writeln('Finding runes took '+IntToStr(TimeFromMark(temp))+' Msec');
    end;

    Dunno if any use.

    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
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it looks okay but im using if thens because other wise i can use a earth/water staff so.. but it looks nice

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

    Default

    Yea, true. Does it work now for you?

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

  20. #20
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post
    Yea, true. Does it work now for you?
    i fixed the begins and ends and it didnt worked few mins after it did :S
    but still thanks you could use that findrune shit in the srl include to fidn each rune

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

    Default

    lol, i dont know how to fix it, but its a cool idea =] go herps go.
    ~ Metagen

  22. #22
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    its was my idea ^^ but he made that array shit( i can use array, bc problems with combillity)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Speed Test [Test your connection and share!]
    By yanix in forum News and General
    Replies: 2
    Last Post: 12-17-2007, 09:27 PM

Posting Permissions

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