Mr. Doctor
2009-12-09 17:14:20
Here are some of the procedures/functions I made and entered them into the Jr Comp #2.
Someone should edit DragItem because it moves the mouse too fast and may skip the item.
{*******************************************************************************
Function Function DropFT(FromS: Integer; ToE: Integer): Integer;
By: Junkj
Description: Drops items from FromS to ToE. Like DropTo
*******************************************************************************}
Function DropFT(FromS: Integer; ToE: Integer): Integer;
Var FromF,ToT,I :Integer;
Begin
If(InvEmpty) Then Exit;
FromF := FromS
ToT := ToE
GameTab(tab_inv);
For I:= FromS To ToT do
DropItem(I);
end;
{*******************************************************************************
Function InvOption(Option: integer):integer;
By: Junkj
Description: Goes to your inventory and opens up a random screen
and closes it or opens up your specified window and does not close it
0- Random and close
1- Equipment Stats
2- Price Checker
3- Items on death
*******************************************************************************}
Function InvOption(Option: integer):integer;
Var Op :integer;
begin
Op := Option;
If(Op = 0) then
begin
Gametab(Tab_Equip)
Wait(100+random(50))
Case Random(3) of
0: Mouse(588, 434, 3, 3, True);
1: Mouse(641, 434, 3, 3, True);
2: Mouse(701, 429, 3, 3, True);
end;
Wait(1000+Random(100))
CloseWindow;
end else
Op := Option;
If(Op >= 1) and (Op <= 3) then
begin
Gametab(Tab_Equip)
Wait(100+random(50))
Case op of
1: Mouse(588, 434, 3, 3, True);
2: Mouse(641, 434, 3, 3, True);
3: Mouse(701, 429, 3, 3, True);
end;
end else
Op := Option;
If (Op > 3) or (Op < 0) then
begin
Writeln('Option '+ inttostr(Op) + ' does not exist')
end;
end;
{*******************************************************************************
Procedure SetRandomObj;
By: Junkj
Description: Sets a random objective.
*******************************************************************************}
Procedure SetRandomObj;
var RanObj,NoO,x,y :integer;
begin
NoO := BitmapFromString(23, 12, 'beNqNUQEOwiAQ40Fs2RJdnA4j0' +
'/3/SbO7jnpiNJLLpZT2KCH116G5nZrpEPO5BZ7RjzvDPhc+DYUZjR' +
'lb08TdNbxcxI6JmAmNpuXSMTMbjz5bresKF8vjb5XNwsUhmMwtbwQ' +
'IIfgX6V3EyAANerClS2nklhiW6nZm9vrqFRqiLl6aXCbQ+OcQnirh' +
'jyT4qSX13ugxwP3SiYESXQwm0Eve6z+9BFDC9UhdxQBDLD1IYfHU8' +
'NSXvpgu5qQxW0JiJuc/MnnVQ1mQLdM2GTk3bLcwhq8qxls9AVo+Ey' +
'o=');
RanObj := BitmapFromString(14, 14, 'beNp1kj0Lg2AMhN8fJ52ko6' +
'M4ttS1YJdSKE5O/cX6wMH1CPhyQ3K5fJi4DK/5ui7D7zuB571/TJf' +
'b2AEM3ASMo8lTwQIlpmD/NCH1YujoLmJ4FitkPhP1GFuuBnBoe49U' +
'zsRSJ5XALgVdM5WghLBL4lmRoszu2vlZYn6sD+Rhcg+p9HWssayQ2' +
'GL0A7T2l4mnnfcsV4sFyvI1xawH8tTePw==');
GameTab(tab_Objectives);
If(FindBitmapToleranceIn(NoO,x,y,mix1,miy1,mix2,miy2,20)) then
begin
Writeln('Setting Objective')
If(FindBitmapToleranceIn(RanObj,x,y,mix1,miy1,mix2,miy2,20)) then
begin
Mouse(x,y,3,3,true);
Wait(500+Random(250))
Case Random(5) of
0: Mouse(92, 94, 3, 3, true);
1: Mouse(261, 111, 3, 3, true);
2: Mouse(423, 113, 3, 3, true);
3: Mouse(89, 235, 3, 3, true);
4: Mouse(379, 404, 3, 3, true);
5: Mouse(427, 237, 3, 3, true);
End;
End Else
If(Not(FindBitmapToleranceIn(NoO,x,y,mix1,miy1,mix2,miy2,20))) Then
begin
Writeln('Objective Already Set')
Exit;
end;
end;
end;
{*******************************************************************************
Procedure Function RandomTabs(TimesToSwitch: integer; WaitBetween :integer):integer;
By: Junkj
Description: Switches between random tabs, 0 for randomrange from 1-5.
*******************************************************************************}
Function RandomTabs(TimesToSwitch: integer; WaitBetween :integer):integer;
var TTS,I,WB :integer;
begin
TTS := TimesToSwitch;
WB := WaitBetween;
If(TTS > 0) then
begin
For I:= 0 to TTS do
Case Random(15) of
0: GameTab(tab_Combat);
1: GameTab(tab_Stats);
2: GameTab(tab_Quest);
3: GameTab(tab_Diary);
4: GameTab(tab_Inv);
5: GameTab(tab_Equip);
6: GameTab(tab_Prayer);
7: GameTab(tab_Magic);
8: GameTab(tab_Friends);
9: GameTab(tab_Ignore);
10: GameTab(tab_Clan);
11: GameTab(tab_Options);
12: GameTab(tab_Emotes);
13: GameTab(tab_Music);
14: GameTab(tab_Notes);
15: GameTab(tab_Logout);
end;
Wait(WB)
end else
TTS := TimesToSwitch;
WB := WaitBetween;
If(TTS <= 0) then
begin
Case Random(4) of
0: TTS := 1;
1: TTS := 2;
2: TTS := 3;
3: TTS := 4;
4: TTS := 5;
end;
For I:= 0 to TTS do
Case Random(15) of
0: GameTab(tab_Combat);
1: GameTab(tab_Stats);
2: GameTab(tab_Quest);
3: GameTab(tab_Diary);
4: GameTab(tab_Inv);
5: GameTab(tab_Equip);
6: GameTab(tab_Prayer);
7: GameTab(tab_Magic);
8: GameTab(tab_Friends);
9: GameTab(tab_Ignore);
10: GameTab(tab_Clan);
11: GameTab(tab_Options);
12: GameTab(tab_Emotes);
13: GameTab(tab_Music);
14: GameTab(tab_Notes);
15: GameTab(tab_Logout);
end;
Wait(WB)
end;
end;
{*******************************************************************************
Function HumanNote(Note: String):String;
By: Junkj
Description: Types in a note that you have specified.
*******************************************************************************}
Function HumanNote(Note: String):String;
Var x,y,AddNote,T :integer;
Var NoteIn:string;
begin
AddNote := BitmapFromString(12, 11, 'beNoz0tBWltZTUwCSQCTEw' +
'QZHEBEjNeVgHxc0Nb0b0oEIrkZfQw6oDKgAiIBsIEJWAxEBImNtZT' +
'Qr4GrgCKgMoqZ1VRwEARVM3JQN52KqaVgegYzQ1MARRBbTLoibIYr' +
'haiAiEDdryopA2BB/wdVA/A5BKlJCQGVaCmIQNWhWAAPHQE0WaBRE' +
'GbJGCIIIWgIAlstNsQ==');
Gametab(Tab_Notes);
MarkTime(T)
Repeat
Wait(500+Random(2500))
Until(FindBitmapToleranceIn(AddNote,x,y,mix1,miy1,mix2,miy2,20)) or (TimeFromMark(T) = 25000)
If(FindBitmapToleranceIn(AddNote,x,y,mix1,miy1,mix2,miy2,20))Then
begin
Mouse(x,y,3,3,True)
FreeBitmap(AddNote)
Wait(500+Random(100));
NoteIn := Note;
Typesend(NoteIn);
end;
end;
{*******************************************************************************
Function ExamineAtSlot(InvSpot: Integer; RandomSpot: Integer): integer;
By: Junkj
Description: Examines at specified slot, or picks a random spot and
examines it.
1-Random (For RandomSpot: Integer;
0-YourSpot
*******************************************************************************}
Function ExamineAtSlot(InvSpot: Integer; RandomSpot: Integer): Integer;
var Spot,EXAMORIGNMOSSPED,x,y,I,RR :integer;
begin
If(invempty)then exit;
I := RandomSpot;
If(I = 0)then
begin
Spot := InvSpot;
Writeln('Examining at spot '+ inttostr(InvSpot))
EXAMORIGNMOSSPED := MouseSpeed;
MouseSpeed := 15;
MMouseItem(Spot);
getmousepos(x,y);
Mouse(x,y,3,3,false);
waitoption('xamine',500);
MouseSpeed := EXAMORIGNMOSSPED;
end else
If(invempty)then exit;
I := RandomSpot;
If(I = 0)then
begin
Spot := InvSpot;
If(not(existsitem(Spot)))then
begin
writeln('No item specified at slot '+ inttostr(spot));
exit;
end else
If(invempty)then exit;
I := RandomSpot;
If(I = 0)then
begin
spot := InvSpot;
if(spot > 28) or
(spot < 1) then
begin
Writeln('Inventory spot specified does not exist!');
exit;
end else
If(invempty)then exit;
I := RandomSpot;
if(I = 1) then
begin
repeat
RR:= RandomRange(1,28)
until(existsitem(RR))
EXAMORIGNMOSSPED := MouseSpeed;
MouseSpeed := 15;
MMouseItem(RR);
getmousepos(x,y);
Mouse(x,y,3,3,false);
waitoption('xamine',500);
MouseSpeed := EXAMORIGNMOSSPED;
end;
end;
end;
end;
Someone should edit DragItem because it moves the mouse too fast and may skip the item.