PDA

View Full Version : PsychoSon's VE Powerminer



psychoson
06-19-2007, 08:41 AM
heres my first script. Tell me anyway i can improve im trying to get into srl..so i would like to make it the best i can ty.Its for Varrock east because i wanted to learn radial walk so i made it if you die it will walk back to the mine..Tell me how you like it :sasmokin:


program VarrockPowerMiner;
{.Include SRL/SRL.Scar}
{.Include SRL/SRL/Skill/Mining.Scar}
{.Include SRL/SRL/Skill/Magic.Scar}
Const RgBoxes =True;

function FindFastRandoms :Boolean;
var
RL: Integer;
begin
for RL:=1 to 17 do
begin
case RL of
1: CloseWindow;
2: if FindTalk then
Result := True;
3: if FindDead then
Result := True;
4: if FindMod then
Result := True;
5: if FindMime then
Result := True;
6: if FindMaze then
Result := True;
7: if FindQuiz then
Result := True;
8: if FindDemon then
Result := True;
9: if FindScapeRune then
Result := True;
10: if FindTalk then
Result := True;
11: if FindLamp(LampSkill) then
Result := True;
12: if (FindNewBox) then
begin
Result := True;
if(RGBoxes = True)then
begin
if(not(GambleNewBox))then
LogOut;
end else
SolveBox;
end;
13: if FindTrade then
Result := True;
14: begin
if NoGameTab then
begin
if ( SolveFrog ) then Exit;
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
15: if SolvePinball then
Result := True;
16: AntiBan;
17: if(FindFight)then
begin
RunAwayDirection('S');
RunBack;
end;
end;
wait(15);
end;
end;

Procedure MineingFail1; // I Find It Easier To Do In A Seperate Procedure.
Begin
If (InChat('you are dead'))or (FindSymbol(x,y,'cooking')) Or (FindSymbol(x,y,'Water')) Then
begin
RadialRoadWalk(FindRoadColor, 60, 93, 5, 1, 1);
RadialRoadWalk(FindRoadColor, 73, 96, 65, 1, 1);
RadialRoadWalk(FindRoadColor, 58, 84, 50, 1, 1);
RadialRoadWalk(FindRoadColor, 73, 103, 60, 1, 1);
RadialRoadWalk(FindRoadColor, 333, 370, 65, 1, 1);
RadialRoadWalk(FindRoadColor, 318, 360, 65, 1, 1);
RadialRoadWalk(FindRoadColor, 337, 360, 65, 1, 1);
RadialRoadWalk(FindRoadColor, 317, 336, 59, 1, 1);
RadialRoadWalk(FindRoadColor, 346, 366, 71, 1, 1);
RadialRoadWalk(FindRoadColor, 21, 53, 70, 1, 1);
RadialRoadWalk(FindRoadColor, 33, 69, 67, 1, 1);
if(FindSymbol(x, y, 'quest')) then
Mouse(x, y, 2, 2, true)

repeat
Mouse(682, 23, 2, 2, true)
Wait(5000+random(1000))
until (FindSymbol(x, y,'mining site'))
if (FindSymbol(x, y,'mining site')) then
Mouse(x, y, 2, 2, true)
end;
end;

Procedure MineingFail2;
begin
If Not (FindSymbol(x,y,'mining')) then
GameTab(7);
Cast('1');
end;

procedure Randoms;

begin
FindTalk; //looks for a few letters from characters name (Nick) for randoms
FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
FindFastRandoms;
FindLamp('mining'); //if finds the lamp, picks the skill
if FindFight then //if finds that you're in a fight
begin
RunAwayDirection('n'); //runs north (s, w, e)
Wait(10000+random(2000)); //waits
RunBack;//Runs back
end;
end;


var Loads,OreDTM:integer;

function CoordsToInvSpot(gx,gy:integer):integer;
var col,row:integer;
begin
if ((gx>569) and(gx<600)) then col:=1;
if ((gx>611) and(gx<642)) then col:=2;
if ((gx>653) and(gx<684)) then col:=3;
if ((gx>695) and(gx<723)) then col:=4;

if ((gy>213) and(gy<244)) then row:=1;
if ((gy>249) and(gy<280)) then row:=2;
if ((gy>285) and(gy<316)) then row:=3;
if ((gy>322) and(gy<352)) then row:=4;
if ((gy>357) and(gy<387)) then row:=5;
if ((gy>393) and(gy<424)) then row:=6;
if ((gy>429) and(gy<459)) then row:=7;

result:=((row-1)*4)+col;
end;


procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
CurrentPlayer:= 0;
NumberOfPlayers(HowManyPlayers);


Players[0].Name :='Shamokin8';
Players[0].Pass :='123123a';
Players[0].Nick :='kin';
Players[0].String1 :='coal'; // What Ore To Mine.
Players[0].String2 :='coal'; // Another Ore To Mine.
Players[0].String3 :='iron';// A Third Ore To mine.
Players[0].Boolean1 := False;
Players[0].Active:=True;

Players[1].Name :='Username';
Players[1].Pass :='Password';
Players[1].Nick :='3 Leters Of Youre Name';
Players[1].String1 :='Iron'; // What Ore To Mine.
Players[1].String2 :='Tin'; // Another Ore To Mine.
Players[1].String3 :='Copper';// A Third Ore To mine.
Players[1].Integer1 := 000;
Players[1].Boolean1 := False;
Players[1].Active:=True;


Players[2].Name :='Username';
Players[2].Pass :='Password';
Players[2].Nick :='3 Leters Of Youre Name';
Players[2].String1 :='Iron'; // What Ore To Mine.
Players[2].String2 :='Tin'; // Another Ore To Mine.
Players[2].String3 :='Copper';// A Third Ore To mine.
Players[2].Integer1 := 00;
Players[2].Boolean1 := False;
Players[2].Active:=True;


Players[3].Name :='Username';
Players[3].Pass :='Password';
Players[3].Nick :='3 Leters Of Youre Name';
Players[3].String1 :='Iron'; // What Ore To Mine.
Players[3].String2 :='Tin'; // Another Ore To Mine.
Players[3].String3 :='Copper';// A Third Ore To mine
Players[3].Integer1 := 9999;
Players[3].Boolean1 := False;
Players[3].Active:=True;


Players[4].Name :='Username';
Players[4].Pass :='Password';
Players[4].Nick :='3 Leters Of Youre Name';
Players[4].String1 :='Iron'; // What Ore To Mine.
Players[4].String2 :='Tin'; // Another Ore To Mine.
Players[4].String3 :='Copper';// A Third Ore To mine.
Players[4].Integer1 := 9999;
Players[4].Boolean1 := False;
Players[4].Active:=True;


Players[5].Name :='Username';
Players[5].Pass :='Password';
Players[5].Nick :='3 Leters Of Youre Name';
Players[5].String1 :='Iron'; // What Ore To Mine.
Players[5].String2 :='Tin'; // Another Ore To Mine.
Players[5].String3 :='Copper';// A Third Ore To mine.
Players[5].Integer1 := 9999;
Players[5].Boolean1 := False;
Players[5].Active:=True;


Players[6].Name :='';
Players[6].Pass :='';
Players[6].Nick :='';
Players[6].String1 :='Iron'; // What Ore To Mine.
Players[6].String2 :='Tin'; // Another Ore To Mine.
Players[6].String3 :='Copper';// A Third Ore To mine.
Players[6].Integer1 := 9999;
Players[6].Boolean1 := False;
Players[6].Active:=True;


end;


Procedure SetupScript;

begin
SetupSRL;
DeclarePlayers;

If(not(LoggedIn))then LoginPlayer;

If(LoggedIn)then
Begin
EquipPick:= Players[CurrentPlayer].Boolean1;
NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
end;


procedure MineOre;
Begin
repeat
if (FindObjMulti('ine',OreColor1,OreColor2,OreColor3, 0)) Then
GetMousePos(x,y);
Mouse(x,y,4,4,true);
Until(InvFull) or (InvCount= 28)

end;

Procedure Drop;

begin
OreDTM:= DTMFromString('78DA634C636060706740038C48249006A9F 12' +
'3A0261F487813A12688809A1C201141847BA209A849021231 04D4' +
'C4028944026AA2893007E4DE28026A828930071436A104D48 4128' +
'E0B0047CA0967');
repeat
if FindDTM(OreDTM,x,y,MIx1,MIY1,MIx2,MIY2) then
DropItem(coordstoinvspot(x,y));
wait(200+random(200));
until not(FindDTM(OreDTM,x,y,MIx1,MIY1,MIx2,MIY2));
freedtm(OreDTM);
Loads:= Loads + 1
End;

procedure Anti;
begin
if(not(LoggedIn))then
Exit;
case Random(13) of

0: RandomRClickEvery(3 + Random(3));

1: begin
HoverSkill('Fishing', false);
wait(2000+random(1000));
GameTab(4);
end;

2: begin
HoverSkill('Cooking', false);
wait(2000+random(1000));
GameTab(4);
end;

3: RotateEvery(2);


4: RandomChatEvery(4 + Random(4));

5: LeaveScreenEvery(10 + Random(4));

6: PickUpMouse;

7: BoredEvery(10 + Random(5));

8: begin
GameTab(1 + Random(12));
wait(1000+random(1000));
GameTab(4);
end;

9: begin
case random(4) of
0: TypeSend('Mining lvls?');

1: TypeSend('Mining Levels?');

2: TypeSend('Smithing lvl?');

3: TypeSend('Smithing levels?');
end;
end;

10: RandomRClickEvery(4);


11: AntiBan;

12: SleepAndMoveMouse(5000+random(3000));

end;
end;


begin
SetUpSRL;
NEWLINE:='';
SetupScript;
repeat
MineingFail2;
MineingFail1;
Anti;
MineOre;
Randoms;
Drop;
Until Loads >= Players[CurrentPlayer].Integer1
if Loads >= Players[CurrentPlayer].Integer1 then
Logout;
NextPlayer(True);
end.

sheetomg
06-20-2007, 04:27 AM
nice

LordGregGreg
06-20-2007, 05:58 AM
I told you already
procedure MineOre;
Begin
repeat
if (FindObjMulti('ine',OreColor1,OreColor2,OreColor3, 0)) Then
GetMousePos(x,y);
Mouse(x,y,4,4,true);
Until(InvFull) or (InvCount= 28)

end; will never pass for all the reasons i mentioned online to you. You need to check for anti randoms, check for gas, and defanitly wait untill you have finished mining the rock.

ZephyrsFury
06-22-2007, 08:47 AM
procedure MineOre;
Begin
repeat
if (FindObjMulti('ine',OreColor1,OreColor2,OreColor3, 0)) Then
GetMousePos(x,y);
Mouse(x,y,4,4,true);
Until(InvFull) or (InvCount= 28)

end;

lol i dont know if this is in the actual script but i got it from greg's post.

if you look at it closely, you'll notice that the script will click continuously, without a wait, until the inv is full.

also isn't InvFull the same as InvCount = 28?

And doesn't the FindObjMulti function also need x and y variables (cant remember properly).

LordGregGreg
06-22-2007, 08:52 AM
procedure MineOre;
Begin
repeat
if (FindObjMulti('ine',OreColor1,OreColor2,OreColor3, 0)) Then
GetMousePos(x,y);
Mouse(x,y,4,4,true);
Until(InvFull) or (InvCount= 28)

end;

lol i dont know if this is in the actual script but i got it from greg's post.

if you look at it closely, you'll notice that the script will click continuously, without a wait, until the inv is full.

also isn't InvFull the same as InvCount = 28?

And doesn't the FindObjMulti function also need x and y variables (cant remember properly).

Yeah, thats all right. I have been working with him a bit on aim or whatever. He is getting the hang of it. I think hes got it to where it wont clik again untill it detects that it has finished mining one now.
Presure him to update :P

ZephyrsFury
06-22-2007, 08:58 AM
lol thats pretty good. my auto chopper never got past autocolouring the trees :(