Results 1 to 3 of 3

Thread: Wierd stuff happends, completely clueless why. 07 Script

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

    Question Wierd stuff happends, completely clueless why. 07 Script

    Firstly I'll describe how the script should work (This is a 07 Script)
    It should firstly open the magic tab, then select the enchant sapphire spell, then click on inventory slot 2 (becuase inv slot 1 has runes), next it will do this but click on inventory slot 3 and so on until slot 28, after it banks and repeats.

    What happens is it fails the select the spell, then clicks on invent slot 2, then 4, then 6, (Can you see a pattern here) not sure why it's doing this.

    Any help would be highly appreciated as I really want to learn to script so I can release some scripts.

    for reference here is the documentation I used for the functions some of you may not be familier with:
    http://docs.villavu.com/srl-5/gameta...light=ftab#id1
    http://docs.villavu.com/srl-5/magic....ighlight=magic

    Here is my full source code

    Code:
    program EnchantingSapphire;
    
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.simba}
    {$i srl/srl/skill/magic.simba}
    var
    i,x:integer;
    const
    const
      tab_Combat = 21;
      tab_Inv = 25;
      tab_Equip = 26;
      tab_Prayer = 27;
      tab_Magic = 28;
    
    procedure enchant;
    begin
    Ftab(tab_Magic);//selects the magic tab, using F keys
    i:=2;
    for i:= 2 to 27 do     //loops to do each inventory item
    begin
    (Cast('Lvl-1 Enchant', false));   //finds the spell name and clicks on it once
      Writeln('Casting spell');
      Wait(RandomRange(100, 350));
      InvMouse((i), 1);              //clicks the invent slot (i = invent slot and 1 is the input click)
      Wait(RandomRange(1700, 2000));
    end;
    Writeln('Finished Enchanting');
    end;
    
    procedure doBank();
    begin
    Wait(RandomRange(1000, 2000));
    writeln('Banking');
    if OpenBankFast('vwb') then
    begin
    Deposit(2,28,True)
    Wait(RandomRange(600, 1300));
    WithdrawEx(8,1,27,['apphire race','ace','re ac']);
    Wait(RandomRange(750, 1235));
    CloseBank; //closes bank
    
    end;
    end;
    
    begin
    SetupSRL;
    activateclient;
    ClearDebug;
    writeln('Start script with a full inv of un-enchanted braces, runes in slot 1 ');
    x:=0
    while x<1000 do
    begin
    enchant();
    doBank();
    x:=x+1;
    end;
    end.
    Last edited by IceTruckKiller; 03-30-2013 at 07:30 PM.

  2. #2
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    It would be wise to make it click on the spell, then move the mouse to the slot and check the UpText (i.e. 'cast' or what ever) before clicking the mouse. If the UpText doesn't match then it would select the spell again

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

    Default

    Quote Originally Posted by The Mayor View Post
    It would be wise to make it click on the spell, then move the mouse to the slot and check the UpText (i.e. 'cast' or what ever) before clicking the mouse. If the UpText doesn't match then it would select the spell again
    Yeah I agree, thanks

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
  •