stuartroad
2012-06-04 02:03:42
Hey guys, this is my first script and I am really struggling with a few certain things. Here is my list:
Please fire your constructive criticism cannon at me :)
I have tried to use FindBlackChatMessage to wait till a fire is made before starting the bonfire bit but I cannot seem to make this work, is there something else I could use, I know I need to put in a bit that searches for a fire also.
- Cuts a new tree before finished cutting last one,
- Sometimes randomly stops cutting, hovers over the tree and is waiting for it to be felled but never happens cause it doesn't right click, has something to do with the above error.
- Makes a fire fine.
- Doesn't wait till the fire is made before starting to add to bonfire.
- After removing the bonfire bit, It just ends the script once it has made 1 fire.
Please fire your constructive criticism cannon at me :)
program BarbarianChopNBonfire;
{$DEFINE SMART}
{$i srl\srl.simba}
const
SRLStats_User = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True;
Version ='1.0';
Leftclick = 'True'; // Left click add to Bonfire
Log = 'NormalLog'; // NormalLog, Oak, Willow, Maple, Yew, Magic ;
var
Start, Ending, LevelsGained, FireSpirts, LogsCutAndBurnt, TotalXP, x, y, NormalLog, Oak, Willow, Maple, Yew,
Found: Extended;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='@hotmail.com';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Pin := ''; //don't need
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'ssence'];
Players[0].Member := True;
Players[0].Active:=True;
end;
procedure StartingXp;
begin
Start := GetXPBarTotal
Writeln ('Getting Starting Xp');
end;
procedure EndingXp;
begin
Ending := GetXPBarTotal
Writeln ('Getting Ending Xp');
end;
Procedure LevelUps;
begin
if (LevelUp) then
Inc (LevelsGained);
Writeln('Gained a Level!');
end;
function AddLogsToFire: Boolean;
begin
if FindBlackChatMessage ('add') then
begin
Result := True;
end else Result := False;
Writeln ('Adding the logs to bonfire');
end;
procedure LogsCutBurnt;
begin
if FindBlackChatMessage('You add a log to the fire') then
Inc(LogsCutAndBurnt)
end;
procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
case Random(8000) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
FindNormalRandoms;
end;
3:
begin
HoverSkill('Firemaking', false);
wait(2453+Random(432));
end;
end;
end;
procedure Chop;
var x, y: integer;
begin
begin
repeat
FindNormalRandoms
if FindObj(x,y,'ver', 1453860, 35) then
Writeln ('Found Tree');
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
Writeln ('Chopping Tree');
end;
repeat
Wait(300+ random(300));
until not IsUpText('ree') or (InvFull);
until (InvFull);
Writeln ('Invent Full, Burning');
end;
end;
procedure MakeFire;
var
x, y, NormalLog: Integer;
begin
if not LoggedIn then Exit;
if not (getCurrentTab = tab_Inv) then
FTab (tab_Inv);
begin
NormalLog := DTMFromString('mLgAAAHicY2JgYNBiYmAwAWJ9RgYGHSAOtldlcDCQYWAFyoEwIxQzMAAAOcMCEQ==');
if FindDTM(NormalLog, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 2, 2);
if IsUpText('og') then
Writeln('Found Log');
begin
ClickMouse2(mouse_right);
WaitOption('ight', 300);
Writeln('Burning Log');
end;
end;
end;
end;
procedure BonFire;
var x, y, NormalLog: Integer;
begin
if not LoggedIn then Exit;
if not (getCurrentTab = tab_Inv) then
FTab (tab_Inv);
if InvEmpty then
Chop;
begin
NormalLog := DTMFromString('mLgAAAHicY2JgYNBiYmAwAWJ9RgYGHSAOtldlcDCQYWAFyoEwIxQzMAAAOcMCEQ==');
if FindDTM(NormalLog, x, y, MIX1, MIY1, MIX2, MIY2) then
Writeln('Found Log');
ClickMouse2(mouse_left);
begin
Wait(250+random(150));
WaitOption('Add to bonfire', 200);
MouseBox(305, 420, 315, 435, mouse_Left);
Writeln('Making Bonfire');
while ExistsItem(27) do wait(100); //wait until last slot empty
end;
end;
end;
begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
Smart_Server := 35;
ActivateClient;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) Then
begin
LoginPlayer;
end;
ClickNorth (SRL_ANGLE_HIGH);
wait(40+random(20));
repeat
Chop;
MakeFire;
BonFire;
Antiban;
until(false)
end.
I have tried to use FindBlackChatMessage to wait till a fire is made before starting the bonfire bit but I cannot seem to make this work, is there something else I could use, I know I need to put in a bit that searches for a fire also.