himranger
2007-06-25 09:46:24
<!– BEGIN TEMPLATE: formanswers –>
himranger - SRL Member Application Form
himranger
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
Some JAva..
Other Communitys
www.sl-forums.com
How Long have You Played Runescape
2 years…
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
HEy all, am Himranger, am not that new to srl-forums, been latley studying some Scar funtions and procedures, i've created 2 autominers,the update version is theworking one, i also got Extemespowerchopper that cuts all kinda trees and use the Srl droppingProcedures.
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
——————————————————
<!– END TEMPLATE: formanswers –>
himranger - SRL Member Application Form
himranger
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
Some JAva..
Other Communitys
www.sl-forums.com
How Long have You Played Runescape
2 years…
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
HEy all, am Himranger, am not that new to srl-forums, been latley studying some Scar funtions and procedures, i've created 2 autominers,the update version is theworking one, i also got Extemespowerchopper that cuts all kinda trees and use the Srl droppingProcedures.
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
{----------------------------Himranger Power Miner v 1.0------------------------------------}
//*This is my second try of a power miner that is fine,with a complicated setup:P
//*Will mine 2 types of Rocks!..
//*will talk randoms fast..
//--->ENjoy the script!
Program AutoMiner;
Const
// USer and Pass setup:
UsernameM = 'Username'; //Your username
PasswordM = 'PAssword'; //Your password
//Character setup
RunningOn = True; //Runs?
//Mining setup
OreLoads = 100; //How many inv loads of primary rock?
OreLoadsX = 5; //How many loads of secondary rock? X rocks
RockTimer = 7; //How long does it usually take for you to mine the rock?
OtherRockMark = 10; //How many loads to mine until the script switches rocks
PickEquipped = True; //Do you have your pickaxe equipped?
DropSpeed = 300; //How fast do you want to drop items? Milliseconds
RockRange = 1; //0 = default, 1 = nearby (2 and 3 in development/coming soon)
MineOthers = False; //Do you want to mine the other rock colors? X rocks
//Primary rock setup
RockColor1 = 1712440; //Color of rock you want to mine
RockColor2 = 1515315; //Secondary color of rock you want to mine
RockColor3 = 2701402; //Third color of rock you want to mine
//Secondary rock setup
RockColorX1 = 0; //Another rock you want to mine
RockColorX2 = 0;
RockColorX3 = 0;
//Ore color setup
OreColorS1 = 5008774; //Color of ore in inventory - I suggest brownish part
OreColorS2 = 8947858; //Another color of ore in inventory
//Secondary ore color setup
OreColorX1 = 5140361; //Color of secondary ore for X rocks
OreColorX2 = 4678779;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\Mining.scar}
Var
SwingPick, MinedOre, Connectionlost : Integer;
RocksMined, FightsFound, GasFoundX, OreLoadsXX : Integer;
MineMode, ColorUpdateMark : Integer;
AutoRockColor, RockModeMark : Integer;
IsMiningRock, ConnectedToGame : Boolean;
RColor1, RColor2, RColor3, RRange, PicksX, LostCount : Integer;
RangeXX, RangeYY, RangeXXX, RangeYYY : Integer;
Procedure ScriptLog;
Begin
Writeln('H.ranger power miner by Himranger -- Script Log:');
Writeln('----------');
Writeln('Ores Mined: ' + IntToStr(RocksMined));
Writeln('Loads Mined: ' + IntToStr(OreLoadsXX));
Writeln('Fights Found: ' + IntToStr(FightsFound));
Writeln('Gas Found: ' + IntToStr(GasFoundX));
Writeln('Randoms Found: ' + IntToStr(PicksX));
Writeln('----------');
End;
Function LoginMyPlayer(MyUserX, MyPassX : String): boolean;
Var
WelcomeToRS, tx, ty, tryToConnect : Integer;
Begin
WelcomeToRS := BitmapFromString(26, 10, 'z78DAA554490E03210CFBD2A878A4' +
'F648D5E1FF4FAA843964641C519A830F218B312178A29E68C6F00' +
'07045CFD1AD5CA5E1C5D34DEC7D07768FABE9B891897A5CC75BFD' +
'D0373FA57F602D6F80E894C9D9C65BE79ABBC85C9FC1ED8376D69' +
'FB9991B69AEEB1EEB5031A7C09E6EEB9CF3D7A14AFF74B99D8ADA' +
'2E32AFB6A780EABC92A5964FA67BA3156EF924E47F61CC5BDC152' +
'1DEA9AA7E62F4EBB69964853D70A4C619880CF52F10F5EE2397E8' +
'3692F827FB2AEE34516C12E3B671C72F60BE6A8F');
If (FindBitmapSpiralTolerance(WelcomeToRS, x, y, 210, 177, 500, 322, 15)) Then
Begin
Mouse(458, 288, 5, 5, True);
Wait(400+random(200));
SendText(MyUserX + chr(13));
Wait(500+random(200));
SendText(MyPassX);
Wait(300+random(200));
Mouse(307, 321, 8, 4, True);
Wait(1000 * 5);
If (FindText(tx, ty, 'nvalid', upchars, 240, 180, 530, 240)) Then
Begin
Writeln('PROBLEM: Invalid username or password!');
TerminateScript;
End
Else
If (FindText(tx, ty, 'rror con', upchars, 240, 180, 530, 240)) Then
Begin
Writeln('PROBLEM: Error connecting to server.');
Writeln('Going to stop script..');
Writeln('I still need to make a proper handler for retrying. Sorry..');
TerminateScript;
End
Else
If (Not(FindText(tx, ty, 'nvalid', upchars, 240, 180, 530, 240))) Then
Begin
Writeln('Note: Waiting 9 seconds just incase internet speed is slow.');
Wait(1000 * 9+random(2)+1);
If (FindColorSpiralTolerance(x, y, 16777215, 351, 325, 490, 343, 5)) Then
Begin
Mouse(x, y, 6, 6, True);
Wait(2000+random(1400));
If (GetColor(584, 483) = 3852287) Then
Begin
Result:=True;
ConnectedToGame := True;
End
Else
If (Not(getColor(584, 483) = 3852287)) Then
Begin
Writeln('PROBLEM: Login probably failed.');
TerminateScript;
End;
End;
End;
End
Else
Begin
Writeln('Already logged in.');
End;
FreeBitmap(WelcomeToRS);
End;
Function IsInFight(hpbar : Integer): boolean;
Begin
If (FindColorSpiralTolerance(x, y, hpbar, 233, 135, 276, 149, 5)) Then
Begin
Result := True;
End
Else
Begin
Result := False;
End;
End;
Procedure CheckConnection;
Var
IsConnected : Boolean;
WelcomeToRS : Integer;
Begin
WelcomeToRS := BitmapFromString(26, 10, 'z78DAA554490E03210CFBD2A878A4' +
'F648D5E1FF4FAA843964641C519A830F218B312178A29E68C6F00' +
'07045CFD1AD5CA5E1C5D34DEC7D07768FABE9B891897A5CC75BFD' +
'D0373FA57F602D6F80E894C9D9C65BE79ABBC85C9FC1ED8376D69' +
'FB9991B69AEEB1EEB5031A7C09E6EEB9CF3D7A14AFF74B99D8ADA' +
'2E32AFB6A780EABC92A5964FA67BA3156EF924E47F61CC5BDC152' +
'1DEA9AA7E62F4EBB69964853D70A4C619880CF52F10F5EE2397E8' +
'3692F827FB2AEE34516C12E3B671C72F60BE6A8F');
IsConnected := True;
ConnectedToGame := False;
Begin
If (FindBitmapSpiralTolerance(Connectionlost, x, y, 150, 107, 455, 211, 5)) Then
Begin
Writeln('Looks like we lost connection.');
Writeln('Waiting to fully disconnect or reestablish.');
Repeat
Wait(1000 + Random(1000 * 2 + Random(361)));
If (FindBitmapSpiralTolerance(WelcomeToRS, x, y, 210, 177, 500, 322, 15)) Then
Begin
IsConnected := False;
ConnectedToGame := IsConnected;
FreeBitmap(WelcomeToRS);
Writeln('We have been booted from the game.');
Writeln('Waiting 30 seconds before re-connecting.');
Sleep(1000 * 30);
LoginMyPlayer(UsernameM, PasswordM);
End
Else
Begin
IsConnected := True;
ConnectedToGame := IsConnected;
End;
Until (ConnectedToGame = True)
End;
End;
End;
Procedure Randoms;
Begin
If (FindPick = False) Then
Begin
If (NoPick = True) Then
Begin
Writeln('WARNING: No Pickaxe Available - Logging out!');
Logout;
TerminateScript;
End;
End;
If (IsInFight(65280)) Then
Begin
SetRun(True);
MouseFlag(646, 26, 4, 4);
Wait(6000+random(2000));
MouseFlag(651, 146, 2, 2);
Wait(300+random(200));
End;
If (FindMime) Then
Begin
Writeln('[RANDOM] Mime event detected');
End;
If (FindMaze) Then
Begin
Writeln('[RANDOM] Maze event detected');
PicksX := PicksX + 1;
End;
If (Findmod) Then
Begin
Writeln('WARNING: Game moderator detected - logging off!');
Logout;
TerminateScript;
End;
If (solvepinball) Then
Begin
Writeln('[RANDOM] Pinball event detected');
PicksX := PicksX + 1;
End;
If (findforester) Then
Begin
Writeln('[RANDOM] Freaky Forester event detected');
PicksX := PicksX + 1;
End;
If (FindScapeRune) Then
Begin
Writeln('[RANDOM] ScapeRune event detected');
Writeln('WARNING: ScapeRune found! Logging off!');
Logout;
TerminateScript;
End;
CheckConnection;
End;
Procedure MiningRock;
Begin
If (FindBitmapSpiralTolerance(SwingPick, x, y, 20, 416, 208, 431, 20)) Then
Begin
IsMiningRock := True;
End
Else
If (Not(FindBitmapSpiralTolerance(SwingPick, x, y, 20, 416, 208, 431, 35))) Then
Begin
IsMiningRock := False;
End;
End;
Procedure SleepMe;
Var
Sleeper : Integer;
Begin
Repeat
Sleep(1000);
Randoms;
Sleeper := (Sleeper + 1);
Until (FindBitmapSpiralTolerance(MinedOre, x, y, 20, 416, 208, 431, 35) Or
(InvCount >= 28) Or (Sleeper >= RockTimer))
RocksMined := (RocksMined + 1);
End;
Procedure DropOres;
Begin
ClickAllItemsColorTolWait('Drop', OreColorS1, 5, DropSpeed);
If (FindColorSpiralTolerance(x, y, OreColorS2, 561, 211, 730, 458, 5)) Then
Begin
ClickAllItemsColorTolWait('Drop', OreColorS2, 5, DropSpeed);
End;
RockModeMark := (RockModeMark + 1);
If (RockModeMark = OtherRockMark) Then
Begin
If (MineMode = 0) Then
Begin
MineMode := 1;
End
Else
If (MineMode = 1) Then
Begin
MineMode := 0;
End;
End;
End;
Procedure MineRocks;
Var
FindAttempts : Integer;
Begin
If (MineOthers = True) Then
Begin
If (MineMode = 0) Then
Begin
RColor1 := RockColor1;
RColor2 := RockColor2;
RColor3 := RockColor3;
End
Else
If (MineMode = 1) Then
Begin
RColor1 := RockColorX1;
RColor2 := RockColorX2;
RColor3 := RockColorX3;
End;
End
Else
If (MineOthers = False) Then
Begin
RColor1 := RockColor1;
RColor2 := RockColor2;
RColor3 := RockColor3;
End;
If (RockRange = 1) Then
Begin
RangeXX := 197;
RangeXXX := 294;
RangeYY := 102;
RangeYYY := 209;
End
Else
If (RockRange = 0) Then
Begin
RangeXX := 25;
RangeYY := 23;
RangeXXX := 440;
RangeYYY := 294;
End;
Repeat
If (FindColorSpiralTolerance(x, y, RColor1, RangeXX, RangeYY, RangeXXX, RangeYYY, 10) Or
(FindColorSpiralTolerance(x, y, RColor2, RangeXX, RangeYY, RangeXXX, RangeYYY, 10)) Or
(FindColorSpiralTolerance(x, y, RColor3, RangeXX, RangeYY, RangeXXX, RangeYYY, 10))) Then
Begin
MMouse(x, y, 2, 2);
Wait(100+random(50));
If (IsUpText('ine')) Then
Begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Flag;
Randoms;
Wait(600+random(410));
MiningRock;
If (IsMiningRock) Then
Begin
FindAttempts := 0;
LostCount := 0;
GasCheck(x, y-4);
SleepMe;
End;
End
Else
If (Not(IsUpText('Mine'))) Then
Begin
SleepAndMoveMouse(400+random(600));
FindAttempts := (FindAttempts + 1);
If (FindAttempts >= 11) Then
Begin
Mouse(298+random(10)-random(5), 111+random(10)-random(4), 5, 5, True);
Flag;
Wait(300+random(200));
LostCount := (LostCount + 1);
If (LostCount >= 4) Then
Begin
If (FindColorSpiralTolerance(x, y, 5392717, 600, 48, 664, 133, 30)) Then
Begin
Mouse(x, y, 5, 5, True);
Flag;
Wait(300+random(200));
End;
End;
End;
End;
End
Else
If (Not(FindColorSpiralTolerance(x, y, RColor1, RangeXX, RangeYY, RangeXXX, RangeYYY, 10) Or
(FindColorSpiralTolerance(x, y, RColor2, RangeXX, RangeYY, RangeXXX, RangeYYY, 10)) Or
(FindColorSpiralTolerance(x, y, RColor3, RangeXX, RangeYY, RangeXXX, RangeYYY, 10)))) Then
Begin
SleepAndMoveMouse(1000+random(200));
FindAttempts := (FindAttempts + 1);
End;
Until (InvCount >= 28)
End;
Procedure LoadMinerBmp;
Begin
SwingPick := BitmapFromString(56, 7, 'z78DAB595C10AC4200C447FC9164AE' +
'B3181FDFF5F5AB03D44E24CC75DF410C2289A794DD5AB1DD7E62D' +
'9636BADCCC2FF3B0E689B79E239F8DD1ED53776925AA41897BADE' +
'791DD495E661D813A95734B1A79E781DE183EFACD33524D790123' +
'568EAA852E68FF202FBAEB599EDD2CA5D72981DE80678ADCD7A05' +
'AA40BCACBCAEC1A9DAEF054BA0ED043DC149EA83F393794EBCA04' +
'4F4463054FD49F51CF0C857B893B5DCE53A1A1F4F03F3C27F7E72' +
'F20FF6A289794D53C859B9CFF897025DA99DEFC3FBE14F4E6D779' +
'EA557D01F56C1254');
MinedOre := BitmapFromString(61, 7, 'z78DAB555410AC3300CFB523618B4C' +
'704F6FF2F8DAD3DC8A8526CD6F4608A221C5B51E2D6BEDFD8FB6B' +
'7B84D8FBD8FA111B7DB88A9C808FFEDE9F27FEFB3F23AC3213F30' +
'404AB823A2F6AA35E1097398BFD4A26760AD157183414FA4B8476' +
'5135048ECA468A5DD426B4950A5BA63AD389BB10072F219239E50' +
'96E555DA2B6F5764655890BC796D516FADFA0B6F2369F35BF273E' +
'5BC687696F4BC75A0FA7FA4D30F3EF526177D5BBC83FD1F6D67E0' +
'373B5DAE276CB77DB4F22F2497E6695A740A23B5FA19AB3FFBC24' +
'2926DF71F69B55BEC0AC46EBFF2571410D4AED237E008D874169');
Connectionlost := BitmapFromString(75, 11, 'z78DAED96510EC0200843AFC429BC' +
'FF91F6391393A5584026F473E9D0FA8222F26A4C9256B898935FF' +
'FBD9B63CE747BBBAAD9714DF06E82A7CE2486E058F45DD3CA89AF' +
'8E38F13A7ED971164816BEBE001311EFB47AC1B53DE891DD6A5D3' +
'F82D99C9104F7EEBA0A04B5F7580582CC976C9D5599A0ED2CE197' +
'57DB89B8879F283C08327357EB2F7A001D30EEAE');
End;
Begin
Writeln('Himranger'#39's presets: Himranger Power Miner 1.0');
Writeln('---First SCript----');
Writeln('Loading script bitmaps...');
LoadMinerBmp;
Writeln('Loaded script bitmaps!');
ActivateClient;
Writeln('Setting up SRL...');
SetupSRL;
Writeln('Setting up SRL Mining...');
SetupSRLMining;
Writeln('Loading SRL Mining bitmaps...');
LoadMiningBitMaps;
Writeln('Loaded SRL Mining bitmaps!');
MineMode := 0;
EquipPick := PickEquipped;
Wait(1000+random(400));
LoginMyPlayer(UsernameM, PasswordM);
Begin
ChatsOff;
SetRun(RunningOn);
Repeat
MineRocks;
If (InvCount >= 28) Then
Begin
Randoms;
DropOres;
Writeln('Making sure chats are off...');
ChatsOff;
End;
ScriptLog;
LoginMyPlayer(UsernameM, PasswordM);
Until (OreLoadsXX = OreLoads)
Writeln('Miner done.');
Logout;
End;
End.——————————————————
<!– END TEMPLATE: formanswers –>