Results 1 to 7 of 7

Thread: Need a some help

  1. #1
    Join Date
    Aug 2007
    Posts
    213
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need a some help

    First time scripting, trying to make an autocurser.
    Code:
    program Auotcurser;
    {.include srl/srl.scar}
    
    
    Procedure LoginButton;
    Begin
     Mouse(364,171,1,1,true)
     Wait(1000+Random(1000))
     WriteLn('Clicked Existing User Button')
    end;
    
    Procedure UsernamePassType;
    Begin
     Mouse(328,260,1,1,true)
     Wait(1000+Random(1000))
     TypeSend('') // username here!
     wait(1000+Random(200))
     TypeSend('') // password here
    end;
    
    Procedure LoginFinish;
    Begin
     Mouse(366,366,1,1,true)
     Wait(3000+Random(2000))
     WriteLn('clicked login button')
     Mouse(380,347,1,1,true)
     Wait(3000+Random(2000))
    end;
    
    Procedure CastCurse;
    Var
    Ax, Ay : Integer;
    
    Begin
     Begin
     GameTab(7);
     Wait(500+Random(600))
     ;FindObjCustom(Ax, Ay,  ['ast, urse'], [15533737], 15)
     MMouse(Ax, Ay, 4, 4);
     If(IsUpText('urse'))Then
      Mouse(Ax, Ay, 4, 4, true);
     wait(1000+random(500))
     ;FindObjCustom(Ax, Ay,  ['onk, orak'], [3752096], 10)
     Mouse(Ax, Ay, 3, 3, true);
     end;
    end;
    
    Begin
     SetupSRL;
     ActivateClient;
     LoginButton;
     UsernamePassType;
     LoginFinish;
    repeat
     CastCurse;
    until(false)
    end.
    I cannot seem to get SCAR to click on the spell 'curse'. Any help with that? Also, how does one use DeclarePlayers to login? Any advice would also be appreciated.

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

    Default

    FindObj searches the mainscreen. It wil not search your magic menu. Try including srl/skills/magic and then using Cast();
    ~ Metagen

  3. #3
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Ok, you have included SRL but you are not using it at all. SRL already has a login function, you just need to set up DeclarePlayers

    SCAR Code:
    Procedure DeclarePlayers;
    Begin
      HowManyPlayers:= *The number of players you want is set here*;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer:= 0;

      Players[0].Name:= 'Player name';
      Players[0].Pass:= 'Player pass';
      Players[0].Nick:= '3 to 4 letters of the name';
      Players[0].Active:= True; //Do you want to use this player when running the script
    End;

    That is a basic DeclarePlayers, you might check the tutorial island for a tutorial about it.

    As for clicking curse, try what metagen said.


  4. #4
    Join Date
    Aug 2007
    Posts
    213
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    FindObj searches the mainscreen. It wil not search your magic menu. Try including srl/skills/magic and then using Cast();
    Ok, you have included SRL but you are not using it at all. SRL already has a login function, you just need to set up DeclarePlayers

    ScarScript: By Drunkenoldma

    Procedure DeclarePlayers;
    Begin
    HowManyPlayers:= *The number of players you want is set here*;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer:= 0;

    Players[0].Name:= 'Player name';
    Players[0].Pass:= 'Player pass';
    Players[0].Nick:= '3 to 4 letters of the name';
    Players[0].Active:= True; //Do you want to use this player when running the script
    End;


    That is a basic DeclarePlayers, you might check the tutorial island for a tutorial about it.

    As for clicking curse, try what metagen said.
    Thank you, I got the cursing and login working

  5. #5
    Join Date
    Aug 2007
    Posts
    213
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Worked a bit more on my script and now this error keeps pestering me.

    Code:
    Failed when compiling
    Line 91: [Error] (16215:4): Semicolon (';') expected in script D:\Program Files\SCAR 3.15\Scripts\Autocurser(Test).scar
    Heres the more-worked-on script:

    Code:
    program Auotcurser;
    {.include srl/srl.scar}
    {.include srl/srl/skill/magic.scar}
    
    Const
     Spells = 10;
     
    Var
    Ax, Ay, i : Integer;
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      CurrentPlayer:= 0;
      NumberOfPlayers(HowManyPlayers);
    
    
      Players[0].Name := '';             // Username.
      Players[0].Pass := '';             // Password.
      Players[0].Nick := 'l';             // 2-4 letters of Username (that are not capital letters or numbers).
      Players[0].Active := True;
    end;
    
    Procedure OnceloggedIn;
    
    Begin
      makecompass('w');
      setAngle(true);
    end;
    
    Procedure CastCurse;
    
    Begin
     Begin
     i:=0
     GameTab(7);
     Wait(500+Random(600))
     Cast('curse');
     MMouse(Ax, Ay, 4, 4);
     If(IsUpText('urse'))Then
      Mouse(Ax, Ay, 4, 4, true);
     wait(1000+random(500))
     ;FindObjCustom(Ax, Ay,  ['onk, orak'], [3752096], 10)
       Mouse(Ax, Ay, 4, 4, true);
     i:=i+1
     wait(1000+random(1000))
     end;
    end;
    
    
    Procedure Logsout;
     Begin
     If (i=Spells) Then WriteLn('Finished casting spells... logging out...');
     Logout;
    end;
    
    Procedure Randoms;
     Begin
     FindNormalRandoms;
    end;
    
    Procedure Proggy;
    Begin
     WriteLn('[-------------------------------------]')
     WriteLn('[-----Zertunami"s Test AutoCurser-----]')
     WriteLn('[-------------------------------------]')
     WriteLn('[  Ran for ' + TimeRunning + '        ]')
     WriteLn('[ Cast ' + IntToStr(i) + ' Curses     ]')
     WriteLn('[-------------------------------------]')
    End;
    
    
    Procedure Setup;
    Begin
     SetupSRL;
     DeclarePlayers;
     ActivateClient;
     LoginPlayer;
     OnceloggedIn;
     repeat
     CastCurse;
     until(i=Spells)
     Randoms;
     Logsout;
     Proggy;
    end;
    
    Procedure FeedBack;
    Begin
      WriteLn(' Please send me a message about any advice, bugs, suggestions,etc... about the script. Thanks!');
    end.//<------------------------line 91

  6. #6
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    That is because you are supposed to have a semicolon their . To end all functions and procedures you do a semicolon. Only on the main loop do you do a period.

    SCAR Code:
    Program New;

    Procedure SomeProcedureA;

    Begin
    End; //<-Semicolon

    Function SomeFunctionA;

    Begin
    End; //<-Semicolon

    Procedure SomeProcedureB;

    Begin
    End; //<-Semicolon


    Begin // A begin that is not inside a function or procedure starts your main loop

    End. //<-Period, End the main loop with a period


  7. #7
    Join Date
    Aug 2007
    Posts
    213
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Heh, I always thought the period went at the end of the script itself, not the main loop I got rid of the procedure bit before the "begin" of the main loop, added the period there instead of at the end, so it now works. Yay

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
  •