Log in

View Full Version : help with script



gerauchert
06-07-2007, 08:51 PM
ok so im learning how to script and ive got most of the basics down. I am making a very simple powerchopper just to mess around with and get familiar with scripting.
So heres the problem that im having....when it clicks the tree it keeps clicking even if its not on the tree and my guy is running around runescape freaking out lol. What am i doing wrong in the coding for it to do it cuz i have wait time and stuff...help plz

program Powerchopper;
{.include SRL/SRL.scar}

const
TreeColor=665632;

procedure Chop;
begin
repeat
if (findcolor(x,y,TreeColor,MSX1,MSY1,MSX2,MSY2))then
MMouse(x,y,0,0);
Wait(2000 + random(500));
Mouse(x,y,0,0,True);
until
InvCount=(10);
end;
begin
SetupSRL;
repeat
Chop;
until(true);
end.

Ramage
06-08-2007, 02:49 AM
if (findcolor(x,y,TreeColor,MSX1,MSY1,MSX2,MSY2))then
begin //Remember your begins and ends;
MMouse(x,y,0,0);
if(isuptext('ree')) then //From "tree"
Mouse(x,y,0,0,True);
end;

gerauchert
06-09-2007, 01:12 AM
ahh new problem....ty for help it worked for a while but now it is going back to the rapid click bullshit lol...

ive changed it so it right clicks but it still rapid right clicks now lol

program Powerchopper;
{.include SRL/SRL.scar}

var Loads: Integer;

//SETUP HERE//
const
TreeColor=1529936;//set tree color here



//ANTIRANDOMZ//
procedure AntiRandomz;
begin
FindTalk;
FindNormalRandoms;
if(FindFight = True)then
begin
RunAwayDirection('S');
Wait(10500 + random (1300));
RunBack;
end;
end;

//CHOPING PROCEDURE//
procedure Chop;

begin
if(FindColor(x,y,TreeColor,MSX1,MSY1,MSX2,MSY2))th en
begin
repeat
MMouse(x,y,2,1);
if(IsUpText('illow'))then
Wait(5000 + random(250));
Mouse(x,y,3,3,False);
ChooseOption(x,y,'hop');
until(InvFull);
end;
end;
//DROPPING PROCEDURE//
procedure Drop;
begin
GameTab(4);
if(InvFull)then
begin
DropTo(2,28)
Loads:=Loads+1;
end;
end;
//PROGRESS REPORT//
procedure Proggy;
begin
ClearDebug;
Writeln('*************************************');
Writeln('=========== PROGRESS REPORT =========');
Writeln('did' + IntToStr(Loads) + 'Loads' + ' ');
Writeln('*************************************');
end;
//MAIN LOOP//
begin
SetupSRL;
repeat
AntiRandomz;
Chop;
Drop;
Proggy;
until(False);
end.

me_ntal
06-09-2007, 03:47 AM
Just add a wait for how long it takes the tree to fall or one before runescape times out and logs u out. Id say about 1000

gerauchert
06-09-2007, 05:22 AM
ty =p

lol i fixed it by moving the wait time after the mouse click lol............

ok i have a newer problem now (oh joy)

ive made some antiban stuff for my script and it keeps causing the script to stop after cutting one load of logs....where should i be putting the AntiBan procedure at? like in the main loop and anywhere else in the script? any is help appreciated.

program Powerchopper;
{.include SRL/SRL.scar}
var Loads: Integer;

//SETUP HERE//
const

TreeColor=2121808;//set tree color here



//ANTIRANDOMZ//

Function FindFastRandoms: Boolean; // By WT-Fakawi.

Var
i: Integer;

Begin
For I := 1 To 11 Do
Begin
Case I Of
1: If FindDead Then
Result := True;

2: If FindMod Then
Result := True;

3: If FindMime Then
Result := True;

4: If FindMaze Then
Result := True;

5: If FindQuiz Then
Result := True;

6: If FindDemon Then
Result := True;

7: Begin
If NoGameTab Then
Begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
End;
End;

8 : If RC Then
Result := True;

9 : If FindFight Then
Begin
Result := True;
RunTo('S', True);
End;

10: If FindTalk Then
Result := True;

11: If FindTrade Then
Result := True;
End;
Wait(1);
End;
End;

//ANTIBAN//
procedure DontGetBanned;
begin
RotateEvery(5 + random(2));
PickUpMouseEvery(6 + random(2));
HoverEvery(10 + random(2),'random');
RandomRClickEvery(2 + random(1));
LeaveScreenEvery(15 + random(3));
BoredEvery(10 + random(4));
Wait(3000 + random(1779));
end;

//CHOPING PROCEDURE//
procedure Chop;

begin
SetRun(True);
GameTab(4);
Wait(500 + random(250));
if(FindColorTolerance(x,y,TreeColor,MSX1,MSY1,MSX2 ,MSY2,3))then
begin
repeat
MMouse(x,y,2,1);
if IsUpText('illow') then
Mouse(x,y,3,3,False);
ChooseOption(x,y,'hop');
Wait(5000 + random(1200));
FindFastRandoms;
until(InvFull);
end;
end;
//DROPPING PROCEDURE//
procedure Drop;
begin
GameTab(4);
if(InvFull)then
begin
DropTo(2,28)
Loads:=Loads+1;
TimeRunning;
end;
end;
//PROGRESS REPORT//
procedure Proggy;
begin
ClearDebug;
Writeln('*************************************');
Writeln('=========== PROGRESS REPORT =========');
Writeln('did: ' + IntToStr(Loads) + ' Loads');
Writeln('running for: ' + TimeRunning + ' minutes');
Writeln('*************************************');
end;
//MAIN LOOP//
begin
SetupSRL;
FindFastRandoms;
repeat
Chop;
Drop;
Proggy;
DontGetBanned;
until(False);
end.

me_ntal
06-09-2007, 06:54 AM
The antiban should be a case statemement and only choose one of those options

gerauchert
06-10-2007, 08:26 PM
thanks......read tut on cases and helped alot.

ok now im trying to use MarkTime in my chopping procedure to use antirandoms and antiban all in one but I am getting "variable expected error". Can anyone explain how to set up marktime in terms of constants/variables and what numbers (if needed) to use?

Ive read a few tuts on this but i need a lil bit more detail to figure this out cuz im a noob lol...

ty