Ixilisi
2012-11-28 12:13:24
First two are just modified slightly, adding "Chat" to the TypeSendExModified Procedure, as the existing one would try to type it into the actual chat.
Slightly Modified Laimonas171's useActionKey to work with the above thing and to use integer.
and my own completely new function, probably needs the most scrutiny. Takes the x coordinate and returns the slot number (index starting at 1 from the left) that the coordinate corresponds to in the ability's bar.
makes it nice and easy to go:
Slightly Modified Laimonas171's useActionKey to work with the above thing and to use integer.
and my own completely new function, probably needs the most scrutiny. Takes the x coordinate and returns the slot number (index starting at 1 from the left) that the coordinate corresponds to in the ability's bar.
makes it nice and easy to go:
var x, y:Integer;
FindDTM(HumidifyDTM, x, y, 45, 345 - SRL_NAVBAR_INGAME_Y, 474, 378 - SRL_NAVBAR_INGAME_Y);
useActionKey(CoordstoAB(x));procedure TypeSendExModified(Text: string; PressEnter, Chat: Boolean); //This is modified as it defaulted to chatting
var
I: Integer;
begin
if (not PlayerChatActive and chat) then
TypeByte(VK_ENTER);
for i := 1 to Length(Text) do
begin
{$IFDEF SIMBAMAJOR980}
SendKeys(Text[i], 40 + Random(40));
{$ELSE}
SendKeys(Text[i], 30 + Random(30), 30 + Random(30));
{$ENDIF}
Wait(40 + Random(40));
end;
if (PressEnter) then
TypeByte(VK_ENTER);
end;
Function useActionKey(KeyPosition: Integer): boolean; //Laimonas171's useActionKey, modified
begin
Case KeyPosition of
1: begin
TypeSendExModified('1',False, False);
result := true;
end;
2: begin
TypeSendExModified('2',False, False);
result := true;
end;
3: begin
TypeSendExModified('3',False, False);
result := true;
end;
4: begin
TypeSendExModified('4',False, False);
result := true;
end;
5: begin
TypeSendExModified('5',False, False);
result := true;
end;
6: begin
TypeSendExModified('6',False, False);
result := true;
end;
7: begin
TypeSendExModified('7',False, False);
result := true;
end;
8: begin
TypeSendExModified('8',False, False);
result := true;
end;
9: begin
TypeSendExModified('9',False, False);
result := true;
end;
10: begin
TypeSendExModified('0',False, False);
result := true;
end;
11: begin
TypeSendExModified('-',False, False);
result := true;
end;
12: begin
TypeSendExModified('=',False, False);
result := true;
end;
else
result := false;
end;
end;
Function CoordToSlotAB(x: Integer): Integer;
var
SlotNo: Integer; //Returns the slot Number (Index starts at 1) given a coordinates, returns 0 if invalid!
begin
if ((x > 474) OR (x < 45)) then
begin
WriteLn('x is outside the bounds of the ActionBar! (45 - 474)');
Result := 0;
end;
If ((x - (Floor((x - 45)/35)*35))/33 > 1) then
begin
WriteLn('x is inbetween slots');
Result := 0;
end;
SlotNo := Floor((x-10)/35);
Writeln(intToStr(x) + ' ' + IntToStr(SlotNo));
Result := SlotNo;
end;