Saint//+
2013-02-26 18:19:30
I was making a PowerChopper/Log burner that cuts the evergreens west of barbarian Village
I started by looking at YoHoJo's tut and reading other tutorials to get what i have now, and i need to read a lot more :)
What im looking for is a finger pointing me in the right direction to look for more good Tut's
So far from my testing of this script over the past 2 days these are the bugs i have found.
1.)If it misses bonfire button it has to go through a wait to try and press it again, although sometimes it just goes back to cutting a log cuts one then tries to light a new fire and go through the process again
- i used Dtms to find the buttons and after clicking i dont know where to begin with a failsafe to check if its adding log to the fire before waiting for Complete. maybe adding
2.) When adding logs to the bonfire it does not burn all logs in the inventory
-I think this could be solved in a similar way to #1 ?
3.) When checking to see if it lit a fire it would find other fires around and move to next step.
-What would i use to make sure when its lighting a fire that it only looks for the fire im lighting incase there are other fires around? like a way so that it only searches for fire in a certain radius from center?
4.) When cutting trees it just walks where ever and eventually away from any cutable trees
- Is there anyway to anchor the player to a certain area?
5.) It does not log in
- I read some tuts on how to script a log in function but they went completely over my head, im looking for more tuts now and hopefully the more i read the better i will understand but if you know of any good tuts or just in general tips for this it would be much appreciated.
Thank you in advance im going to do a total rewrite of this script after I figure out what i'm missing and what I can improve on.
well here is the code for my script
I started by looking at YoHoJo's tut and reading other tutorials to get what i have now, and i need to read a lot more :)
What im looking for is a finger pointing me in the right direction to look for more good Tut's
So far from my testing of this script over the past 2 days these are the bugs i have found.
1.)If it misses bonfire button it has to go through a wait to try and press it again, although sometimes it just goes back to cutting a log cuts one then tries to light a new fire and go through the process again
- i used Dtms to find the buttons and after clicking i dont know where to begin with a failsafe to check if its adding log to the fire before waiting for Complete. maybe adding
2.) When adding logs to the bonfire it does not burn all logs in the inventory
-I think this could be solved in a similar way to #1 ?
3.) When checking to see if it lit a fire it would find other fires around and move to next step.
-What would i use to make sure when its lighting a fire that it only looks for the fire im lighting incase there are other fires around? like a way so that it only searches for fire in a certain radius from center?
4.) When cutting trees it just walks where ever and eventually away from any cutable trees
- Is there anyway to anchor the player to a certain area?
- I read some tuts on how to script a log in function but they went completely over my head, im looking for more tuts now and hopefully the more i read the better i will understand but if you know of any good tuts or just in general tips for this it would be much appreciated.
Thank you in advance im going to do a total rewrite of this script after I figure out what i'm missing and what I can improve on.
well here is the code for my script
program ChopUntilYouDropOrBurn;
{$Define Smart}
{$i srl/srl.simba}
Const
Playfor=30; /// How Long you want script to run in minutes \\\
BurnLogs='True'; ////Set to False for PowerChopper\\\\
Skiller='False'; ////If true have axe in 1st inv spot\\\\
//Much thanks to AwkwardSaws Handbook of useful functions
//Much Thanks to YohoJo, Abu_jwka, Solidone 40, and DannyRS -- Cited by procedures
//Doesnt support logging in anyway -.-'
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
Var
Runtime:Integer;
LogsCut:Integer;
//says on simba what script is doing --Thanks to YoHoJo Video Tut --
Procedure Statsguise(wat:string);
Begin
Status(wat);
Disguise(wat);
End;
//Anti-Ban -- Much Thanks to Solidone 40's Antiban Tutorial and DannyRS Advice --
procedure AntiBan;
begin
Statsguise('antiban')
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(300) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2400+Random(432));
end;
1: PickUpMouse;
2: MakeCompass('n');
3: BoredHuman;
4: RandomRClick;
5: RandomMovement;
6:
Begin
PickupMouse;
Case Random(12) of
1: RandomRClick;
2: RandomMovement;
End;
End;
end;
end;
//Cuts Logs --Much Thanks To YohoJO Video Tut--
Procedure Chop;
Var
x, y, PlusOne, TreeCounter: Integer;
Begin
PlusOne:= InvCount + 1;
x:=MSCX;
y:=MSCY;
If FindObjTPA(x, y, 794138, 6, 1, 15, 15, 70, ['Chop']) Then
Begin
Statsguise('Chopping')
GetMousePos(x, y)
Case Random(2) of
0: //Right Click
Begin
Mouse(x, y, 3, 3, false);
WaitOption('hop', 500);
End;
1: //Left Click
Begin
Mouse(x, y, 6, 6, True);
End;
End;
End;
Flag;
MarkTime(TreeCounter);
Repeat
Antiban;
Wait(2500 + Random(650))
If InvCount=Plusone then
Begin
Statsguise('got one');
Inc(logscut);
GetTimeRunning;
End;
If Invfull = True then
Break;
Until (invcount=PlusOne) or (TimeFromMark(TreeCounter) > 5000)
End;
//Drops Logs
Procedure Droplogs;
Begin
Statsguise('Dropping Logs')
If Invfull = True Then
Begin
If Skiller='True' Then //drops all but 1st inv spot
DropArray([2,3,4,8,7,6,5,9,10,11,12,16,15,14,13,17,18,19,20,24,23,22,21,25,26,27,28])
Else
Dropall; //Drops everything
End;
End;
//Adds to bonfire -- Buggy
Procedure Addtofire;
Var
X, y: Integer;
Begin
Statsguise('adding Logs')
IF FindObjTPA(x, y, 2177099, 8, 1, 5, 5, 10, ['raft']) Then // Clicks Log icon on Action bar
Mouse(x, y, 4, 4, True);
Wait(2000 + Random(1500))
IF FindObjTPA(x, y, 2177099, 8, 1, 5, 5, 10, ['elect']) Then //Clicks log icon on craft menu
Mouse(x, y, 4, 4, True);
Wait(120000 + Random(1500))
End;
//lights Fire -- Buggy
Procedure light;
Var
x, y: Integer;
Begin
Statsguise('Lighting fire')
If invfull = True Then
Begin
MouseItem(28, Mouse_Right);
WaitOption('ight', (400));
Wait(5000 + Random(2000));
Begin
If FindObjTPA(x, y, 3054840, 10, 1, 5, 5, 20, ['more']) Then
WriteLn('Found the Fire!!!!');
Wait(1000)
Addtofire;
End;
End;
End;
//not finished might complete if Rewriting Script
//Thanks To Abu_Jwka, even though i didn't do his tut justice here
Procedure Proggy;
Var
ScriTime: Integer;
Begin
ClearDebug;
GetTimeRunning
Scritime:=(GetTimeRunning/1000)
Writeln('~~~Leechs Chop N Drop or Burn~~~');
Writeln('Logs cut:' + IntToStr(Logscut));
Writeln('Time running:' + IntToStr(Scritime))
End;
//Main Loop
begin
ClearDebug;
SetUpSRL;
ActivateClient;
DeclarePlayers;
MarkTime(RunTime)
ClickNorth(SRL_ANGLE_HIGH)
Repeat
Begin
Chop; //chopstree)
Proggy;
End;
If Burnlogs='False' Then
Begin
Droplogs; //Drops logs
Proggy;
End
Else
Repeat
Light; //starts Bonfire
Proggy;
Until invempty = False;
Until TimeFromMark(RunTime) > ((playfor * 1000)*60)
end.