Log in

View Full Version : Scripting help



tvjj
04-28-2012, 06:56 PM
Hey currently i am making a script to go from the seers bank up to relleka im having some issues, as i am trying to learn as i go, the main issue is with the walking, im trying to use sps to do this for me, also i am working looking through scripts to try to find a pickup obj code, but i am having little luck i would be very gratefull if some one would post a couple examples.


here is my script so far...... i know its not to far into dev but im trying lol...


program TVJJsWeedCollector;

{$include srl/srl/misc/smart.simba}
{$I SRL/SRL.simba}
{$I srl/srl/misc/debug.simba}
{$i sps/sps.simba}

Const
SRLStats_Username = ''; //Your SRL stats Username.
SRLStats_Password = ''; //Your SRL stats Password.
BreakEvery = '3'; //How many minutes to break after.
BreakFor = '1'; //How long to break for.
Version = '1.0a'; // No need to touch.
NumbOfPlayers = 1; //How many players are you using
StartPlayer = 0; // Player to start autoing with (0 means first char)

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;

With Players[0] do
Begin
Name := ''; //Player Username
Pass := ''; //Player Password
Pin := ''; //Bank Pin
Active := True;
BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
end;

Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;

var
mypath:TPointArray;

Procedure BankToSeaweed;
begin
SPS_Setup(RUNESCAPE_SURFACE,['6_6','7_6','6_5','6_4',]; //sps areas
myPath := [Point(2737, 2681), Point(2738, 2707),
Point(2779, 2682), Point(2802, 2652),
Point(2801, 2613), Point(2803, 2570),
Point(2802, 2532), Point(2789, 2509),
Point(2768, 2484), Point(2731, 2471),
Point(2677, 2468), Point(2630, 2473),
Point(2589, 2458), Point(2558, 2460),
Point(2535, 2439), Point(2514, 2417),
Point(2484, 2400), Point(2471, 2367),
Point(2449, 2343), Point(2448, 2302),
Point(2451, 2263), Point(2451, 2225),
Point(2483, 2188), Point(2493, 2143),
Point(2508, 2111), Point(2541, 2099),
Point(2579, 2100), Point(2616, 2092),
Point(2637, 2068), Point(2636, 2020),
Point(2635, 1975), Point(2628, 1935),
Point(2629, 1886), Point(2625, 1850),
Point(2620, 1803), Point(2617, 1761),
Point(2616, 1730)]; //mypath
SPS_WalkPath(mypath);
end,
Procedure CollectWeed;

Begin


Begin
end.


also any constructive criticism is appriciated, and don't hesitate to correct me if you see something nooby

Gucci
04-28-2012, 07:34 PM
Not a bad start but your missing quite a few things like standards and such and a few simple things like closing brackets and such here is one with some corrections

program TVJJsWeedCollector;

{$include srl/srl/misc/smart.simba}
{$I SRL/SRL.simba}
{$I srl/srl/misc/debug.simba}
{$i sps/sps.simba}

const
SRLStats_Username = ''; //Your SRL stats Username.
SRLStats_Password = ''; //Your SRL stats Password.
BreakEvery = '3'; //How many minutes to break after.
BreakFor = '1'; //How long to break for.
Version = '1.0a'; // No need to touch.
NumbOfPlayers = 1; //How many players are you using
StartPlayer = 0; // Player to start autoing with (0 means first char)

var
myPath: TPointArray; // Declare the path as global, not in the middle of the script

procedure DeclarePlayers; // Reduced a space
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;

with Players[0] do
begin // Keep uppercase and lowercase constant throughout don't keep switching
Name := ''; //Player Username
Pass := ''; //Player Password
Pin := ''; //Bank Pin
Active := True;
BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
end;

Procedure Antiban; // Mainly fix standards here
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False);

1: Begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
End;

2: ExamineInv;

3: RandomAngle(1);

4: Begin
GameTab(Tab_Stats);
Wait(3000 + Random(500)); GameTab(Tab_Inv);
End;

5: HoverSkill('random', False);
End;
End;

procedure BankToSeaweed; // Made P lowercase to be constant with rest of procedure
begin
SPS_Setup(RUNESCAPE_SURFACE, ['6_6','7_6','6_5','6_4']); //Added closing bracket //sps areas
myPath := [Point(2737, 2681), Point(2738, 2707),
Point(2779, 2682), Point(2802, 2652),
Point(2801, 2613), Point(2803, 2570),
Point(2802, 2532), Point(2789, 2509),
Point(2768, 2484), Point(2731, 2471),
Point(2677, 2468), Point(2630, 2473),
Point(2589, 2458), Point(2558, 2460),
Point(2535, 2439), Point(2514, 2417),
Point(2484, 2400), Point(2471, 2367),
Point(2449, 2343), Point(2448, 2302), // Fixed standards on these
Point(2451, 2263), Point(2451, 2225),
Point(2483, 2188), Point(2493, 2143),
Point(2508, 2111), Point(2541, 2099),
Point(2579, 2100), Point(2616, 2092),
Point(2637, 2068), Point(2636, 2020),
Point(2635, 1975), Point(2628, 1935),
Point(2629, 1886), Point(2625, 1850),
Point(2620, 1803), Point(2617, 1761),
Point(2616, 1730)]; //mypath
SPS_WalkPath(mypath);
end;

procedure CollectWeed;
var
x, y: integer;
begin
If FindObjCustom(x, y, ['eed', 'ick'], [Color1, Color2], Tolerance) then // This is a finding fuction you can use
begin
GetMousePos(x, y);
if IsUpText('whatever the text is') then
begin
ClickMouse2(True);
end;
end;
end;


begin
end.

tvjj
04-28-2012, 07:48 PM
thank you so much, i thought it was that from yohojo's tuts to make the power chopper, but i didnt think it would work to find seaweed as well as trees :D and for the path i was having a syntax error that was confusing the heck out of me lol... im so glad there is experienced people i can check with lol.

ill also keep updating with my progress :D lol

tvjj
04-29-2012, 09:06 PM
I have another question, i am wondering for it to walk along the shore line will i need to make a new path, and also for it to go to the bank will i need to make a new path as well?

Gucci
04-29-2012, 09:08 PM
Yes those will all require new paths

tvjj
04-29-2012, 09:14 PM
ok awesome thanks alot man, im in the progress of moving so writing this is going in half hour incriments every few hours lol.