PDA

View Full Version : My FindTiara and FindTally functions



itSchRis917
07-12-2007, 03:38 PM
Well, I probably made them more complicated than they needed to be (im not good at condensing code.. :rolleyes:). For both of these functions, it searchs the inventory first for the bitmapmask of either a tiara or a tally, if it finds a tiara in the inventory, it equips it. If it finds a tally, it just results as true. If it DOESNT find a tiara in inv, it will check equip page, if its also not there, it will then open the bank, and withdraw the tiara according to Players[CurrentPlayer].String1, which in my Elemental RuneCrafter that i am currently working on is which rune you want to make. It will also withdraw a tally if not found in inventory..



Function FindTiara:Boolean;
Var
Ax, Ay, Tiara : Integer;
Begin
GameTab(4);
Tiara := BitmapFromString(32, 17, 'z78DA3330183EC00D0C06B3D' +
'B70B910597CB0F902D33DF84546DDEF860350EE7E5AA71FFC 7AC9' +
'339978B751E20B62D493672679EE27D546EABA9FBA2E21BEE CA25' +
'D1AA35648529E37DDF0025AE49AA15BAB0EAC2FA8653BFD7D 410B' +
'1B69ED0BCA6B3AFADB421F3793579210030C463C0000D1C68 D5F');
If FindBitmapMaskTolerance(Tiara, Ax, Ay, MIX1, MIY1, MIX2, MIY2, 2, 2)then
Begin
Result:=True;
MMouse(Ax+5, Ay+5, 2, 2)
Case Players[CurrentPlayer].String1 Of
'Water' : Begin
If IsUpText('ater')then
Mouse(Ax+5, Ay+5, 2, 2, True);
End;

'Air' : Begin
If IsUpText('Air')then
Mouse(Ax+5, Ay+5, 2, 2, True);
End;

'Earth' : Begin
If IsUpText('arth')then
Mouse(Ax+5, Ay+5, 2, 2, True);
End;

'Fire' : Begin
If IsUpText('Fire')then
Mouse(Ax+5, Ay+5, 2, 2, True);
End;
End;
End
Else
GameTab(5);
If FindBitmapMaskTolerance(Tiara, Ax, Ay, MIX1, MIY1, MIX2, MIY2, 2, 2)then
Begin
Result:=True;
End
Else
OpenMyBank;
If FindBitmapMaskTolerance(Tiara, Ax, Ay, MIX1, MIY1, MIX2, MIY2, 2, 2)then
Begin
Result:=True;
MMouse(Ax+5, Ay+5, 2, 2)
Case Players[CurrentPlayer].String1 Of
'Water' : Begin
If IsUpText('ater')then
Mouse(Ax+5, Ay+5, 2, 2, True);
CloseBank;
End;

'Air' : Begin
If IsUpText('Air')then
Mouse(Ax+5, Ay+5, 2, 2, True);
CloseBank;
End;

'Earth' : Begin
If IsUpText('arth')then
Mouse(Ax+5, Ay+5, 2, 2, True);
CloseBank;
End;

'Fire' : Begin
If IsUpText('Fire')then
Mouse(Ax+5, Ay+5, 2, 2, True);
CloseBank;
End;
End;
End;
End;


Function FindTally:Boolean;
Var
Ax, Ay, Tally:integer;
Begin
GameTab(4);
Tally := BitmapFromString(26, 31, 'z78DAED984B0EC0200805AFE' +
'429B8FF91BA6DD248080EFAAAB2E739E16B68ED44B397A951 6972' +
'FA0C6B39E3EFDAC774D858DF3971A008D98CE4747ADD47457 89C8' +
'A8A5285C2DADCF9BE6C1F51D575D92EDBFC3E65957536C87F B7B0' +
'8E8E32554ED35CCB798D6F7676DAECDD23D593706F36EADF7 872E' +
'D4562189927F32F1B3D66B5EB4735CF037534BF02');
If FindBitmapMaskTolerance(Tally, Ax, Ay, MIX1, MIY1, MIX2, MIY2, 2, 2)then
Begin
If IsUpText(Players[CurrentPlayer].String1)then
Result:=true;
End
Else
OpenMyBank;
If FindBitmapMaskTolerance(Tally, Ax, Ay, MIX1, MIY1, MIX2, MIY2, 2, 2)then
Begin
If IsUpText(Players[CurrentPlayer].String1)then
Begin
Mouse(Ax, Ay, 2, 2, True);
CloseBank;
Result:=true;
End;
End;
End;