Log in

View Full Version : For a first script



Le Jingle
02-19-2012, 10:31 PM
I was thinking about applying my first script attempt as a newbie with no scripting background towards a Chaos Tunnels monster killing script.

Would this be a wise place for me to start out?

Any opinion welcomed, as well as a better place to start if my idea of a starting point isn't tangible.

Cheers

Spiker
02-19-2012, 11:35 PM
I'm sure you Could do it, but if you have no scripting experience with any language, I think that a woodcutter is always a good place to start. I always recommend a draynor village willow cutter, but you can do whatever you set your mind to. :) Just have patience/perseverance and give it a lot of your time.

Good Luck!

bloopy62
02-20-2012, 01:12 AM
I too am about to set off on my first script journey. Chaos tunnel killer... Sounds pretty good man. Kinda complicated for a first script though. I plan and doing some type of woodcutter (like Spiker recommended). Maybe yews + banking so I can get regular script experience and also walking and banking experience too.

Basically for a first script, at least in my opinion, should help you learn and figure out as much stuff as possible. Just my two cents. Whatever you do though, good luck with it!

Le Jingle
02-20-2012, 04:12 AM
Followed the first YoHoJo's video tutorial; was legit.
One thing I had to redo was the DeclarePlayers procedure, which was outdated I believe.

Here's what I came up with :p :



program PowerChooper;

{$DEFINE SMART}
{$i SRL\SRL.simba}


Const
SRLStats_Username = ''; //Enter your SRL Stats Username
SRLStats_Password = ''; //Enter your SRL Stats Password
BreakEvery = 185; //How many minutes to break after
BreakFor = 20; //How long the break will be for after you choose to break, found in the line above
Version = '1.0'; //The version of which this script is
NumbOfPlayers = 1; //How many players are used in this script?
StartPlayer = 0; //The player you want to start


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
BoxRewards := ['XP', 'xp', 'lamp', 'Gem', 'ithril', 'oal', 'une'];
LampSkill := Skill_Magic;
Active := True;
end;
end;


Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Function CheckAndClick(UpText:String; X,Y:Integer; Stronger:Boolean):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5000) Then
Begin
GetMousePos(x, y);
If Stronger Then
Begin
Mouse(X, Y, 0, 0, False);
Result:=WaitOption('tta', 3000)
End Else
Begin
Mouse(x, y, 0, 0, True);
Wait(100+Random(50));
FFlag(0);
End;
End;
End;


Procedure Antiban;
Begin
Case Random(250) Of
0: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('Woodcutting', False) GameTab(28) End;
1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(9000 + Random(890)); End;
2: Begin StatsGuise('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(4000 + Random(500)); GameTab(28) End;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
End;
End;


Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;


Function ChopDown:Boolean;
Var
seX, seY, PlusOne, TreeCounter: Integer;
Begin
PlusOne:= InvCount + 1;
//FindObjCustom(x, y, ['att', 'ack'], [123456, 123456], 5);
If FindObjCustom(seX, seY, ['Chop', 'down'], [2176055, 2306611, 2635579, 2108462, 2043438, 1714219, 1252122], 5) Then
Begin
StatsGuise('Hooray, we found a tree');
GetMousePos(Sex, Sey);

Case Random(2) Of
0: Mouse(SeX, SeY, 5, 5, True); //True is for left clicking, and fasle is for right clicks
1: Begin
Mouse(SeX, SeY, 5, 5, False);
WaitOption('Chop', 500); //Will wait until the option chop appears on the uptext or after 500 milliseconds has elasped
End;
End; //Cases always need to end
Repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
If InvCount=PlusOne Then
Writeln('We got one');
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 7000)

End;
End;










Begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown;
Until(false);



end.



Had to pause the video to see what he typed frequently.
This was good practice, and hopefully I can advance from WC scripts to more advanced soon :>

[XoL]
02-20-2012, 05:58 AM
Great job :), you can do it!
Try to make it bank now, SPS is a great way to start (Simple walking method)

Nemesis3X
02-22-2012, 04:41 AM
Great job :), you can do it!
Try to make it bank now, SPS is a great way to start (Simple walking method)

Ya, but take a look at DTM Walking too.