guyver
2008-10-15 20:34:29
Hi All!!
This is my first script and would like any and all to give comments please.
As you can see its not quite finished. Hopefully this will work anywhere and I will let you all know when done and tested.
CHEERS!!:eek:
This is my first script and would like any and all to give comments please.
As you can see its not quite finished. Hopefully this will work anywhere and I will let you all know when done and tested.
CHEERS!!:eek:
// Just a simple High Alchr//
// Start in a bank. Enter Player Details//
// This will get either a fire staff, lava staff, staff of fire//
// or fire runes and nats out of bank. Sorry doesn't look for lava runes.//
// Make sure u have the items to alch noted and in inv at spot 1//
// Thats the top Left//
// As usual keep an eye on how this goes//
// A progress counter is included//
// ENJOY!!!!!//
program AlchMe;
begin
{.include SRL\SRL.scar}
const
DirrectionR = 'N'; //Which way to run if in fight and so on.
PickSkill = 'Magic';
Var
LavaStaffDTM, FireStaffDTM, StaffFireDTM, FireRuneDTM, NatureRuneDTM, x, y: Integer;
NoLava, NoFireSt, NoStaff, NoFires, NoNats, AllOk, NoneLeft: Integer;
procedure DeclarePlayers; //Only use players you have.Comment out rest
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := 'YourName';
Players[0].Pass := 'LoginPass';
Players[0].Nick := 'our'; //3 letters of your username, example jonno you would choose onn.
Players[0].Pin := 'IfHaveOne';
Players[0].Active := True;
//Players[1].Name := '';
//Players[1].Pass := '';
//Players[1].Nick := ''; //3 letters of your username, example jonno you would choose onn.
//Players[1].Active := True;
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars);
end;
procedure LoadMyDTMs;
begin
LavaStaffDTM := DTMFromString('78DA63946460608864400189D151609A1188F' +
'F030123484D2CAA9AF88808B81A302D0A24A2709B03A641E68411' +
'50238BDF3D200000097D0BAA'); //change
FireStaffDTM := DTMFromString('78DA63FCC6C8C050C38002624394C0345086E' +
'13F1030BE07B26A71AB01D35F81AC52543591010AA86AFE0059D5' +
'04CCF90E6435E2570300A9E30F58'); //change
StaffFireDTM := DTMFromString('78DA63946460608864400189D151609A1188F' +
'F030123484D2CAA9AF88808B81A302D0A24A2709B03A641E68411' +
'50238BDF3D200000097D0BAA'); //change
FireRuneDTM := DTMFromString('78DA63FCC6C8C050C38002624394C0345086E' +
'13F1030BE07B26A71AB01D35F81AC52543591010AA86AFE0059D5' +
'04CCF90E6435E2570300A9E30F58'); //change
NatureRuneDTM := DTMFromString('78DA63946460608864400189D151609A1188F' +
'F030123484D2CAA9AF88808B81A302D0A24A2709B03A641E68411' +
'50238BDF3D200000097D0BAA'); //change
end;
procedure FindLavaSInBank;
begin
if FindDTM(LavaStaffDTM, x, y, 20, 20, 600, 300) then //Searches Bank Screen
begin
Mouse(x, y, 1, 1, False); // False is Right click
Flag;
ChooseOption('1');
FreeDTM(LavaStaffDTM);
end else
begin
WriteLn('No Lava Staff in Bank');
FreeDTM(LavaStaffDTM);
NoLava := 1;
end;
end;
procedure FindFireSInBank;
begin
if FindDTM(FireStaffDTM, x, y, 20, 20, 600, 300) then //Searches thru whole inventory
begin
Mouse(x, y, 1, 1, False); // False is Right
Flag;
ChooseOption('1');
FreeDTM(FireStaffDTM);
end else
begin
WriteLn('No Fire Staff in Bank');
FreeDTM(FireStaffDTM);
NoFireSt := 1;
end;
end;
procedure FindStaffInBank;
begin
if FindDTM(StaffFireDTM, x, y, 20, 20, 600, 300) then //Searches thru whole inventory
begin
Mouse(x, y, 1, 1, False); // False is Right
Flag;
ChooseOption('1');
FreeDTM(StaffFireDTM);
end else
begin
WriteLn('No Staff of Fire in Bank');
FreeDTM(StaffFireDTM);
NoStaff := 1;
end;
end;
procedure FindFireRInBank;
begin
if FindDTM(FireRuneDTM, x, y, 20, 20, 600, 300) then //Searches thru whole inventory
begin
Mouse(x, y, 1, 1, False); // False is Right
Flag;
ChooseOption('All');
FreeDTM(FireRuneDTM);
end else
begin
WriteLn('No Fire Runes in Bank');
FreeDTM(FireRuneDTM);
NoFires := 1;
end;
end;
procedure FindNatureInBank;
begin
if FindDTM(NatureRuneDTM, x, y, 20, 20, 600, 300) then //Searches thru whole inventory
begin
Mouse(x, y, 1, 1, False); // False is Right
Flag;
ChooseOption('All');
FreeDTM(NatureRuneDTM);
end else
begin
WriteLn('No Nature Runes in Bank');
FreeDTM(NatureRuneDTM);
NoNats := 1;
end;
end;
Procedure BankCheck;
begin
SetRun(True);
wait(700 + Random(150));
if(FindSymbol(x,y,'bank'))then
begin
Writeln('Bank found. Running to Bank');
MMouse(x, y, 5, 5);
wait(100+random(50));
Mouse(x, y, 1, 1, true);
wait(5000+random(1000));
if FindObjCustom(x, y, ['se Ba', 'ank b', 'oth'], [605264, 3685438, 2313826, 6192526], 3) then
begin
MMouse(x,y,5,5);
wait(100+random(50));
Mouse(x,y,1,1,False);
wait(1000+random(500))
if ChooseOption('se-q') then
begin
wait(600 + Random(200));
if (PinScreen) then
begin
InPin(Players[0].Pin);
end;
wait(500 + Random(500));
FixBank;
wait(700 + Random(130));
FindLavaSInBank;
wait(400 + Random(200));
FindFireSInBank;
wait(300 + Random(120));
FindStaffInBank;
wait(800 + Random(330));
FindFireRInBank;
wait(500 + Random(240));
AllOk = NoLava + NoFireSt + NoStaff + NoFires;
if (not (AllOk = 4))
begin
FindNatureInBank;
end else CloseBank;
end;
end else WriteLn('Cannot find the Bank Booth');
end else
begin
writeLn('Cannot Find Bank Icon..Moving Position. Loging out then In');
Mouse(x + 450, y + 170, 10, 10, true); //Moves to another spot to look again West to East//
Flag;
Logout;
LoginPlayer;
end;
end;
procedure MagicAway;
begin
GameTab(4);
//Count number of nature runes
//make noneleft = this amount
if (not (NoneLeft = 0)
repeat
begin
GameTab(7);
//FindText 'Level 55', 'High'
//select 'high alch'
//select item at spot 1 in inv
//wait(3000 + Random(200);
//NoneLeft = NoneLeft - 1;
CheckForAllRandoms;
AntiBanme;
end
until (NoneLeft = 0)
end else Exit;
end;
procedure AntiBanme;
begin
case random(30) of // The larger the number the less AntiBann it does
0: GameTab(5 + Random(12));
1: BoredHuman;
2: begin
SetAngle(False); //Sets camera angle to low view
wait(10+random(10));
SetAngle(True); //Sets camera angle to high view
end;
3: HoverSkill('Magic', False);
4: GameTab(2 + Random(12));
5: RandomMovement;
6: RandomRClick;
7: PickUpMouse;
end;
end;
procedure CheckForAllRandoms;
begin
FindNormalRandoms;
FindInventoryRandoms;
FindNonInventoryRandoms;
FindTalk;
DwarfItem;
if FindFight then
begin
RunAway(DirrectionR, False, 1, 8000); //Runs away in direction 'N'
end; //then runs back after a wait
end;
//MAIN LOOP//
begin
SetupSRL;
ClearDebug;
ActivateClient;
DeclarePlayers;
LampSkill := PickSkill;
NoLava = 0;
NoFireSt = 0;
NoStaff = 0;
NoFires = 0;
NoNats = 0;
AllOk = 0;
if (not (loggedIn)) then
begin
LoginPlayer;
end;
if (RSReady) then
begin
LoadMyDTMs;
MakeCompass('n');
AntiBanme;
CheckForAllRandoms;
BankCheck; //gets items from bank
MagicAway; //start alch
wait(500);
end;
Logout;
end;
end.