PDA

View Full Version : UseActionKey [EoC]



Laimonas171
11-20-2012, 02:14 PM
Simple function, will be helpful from today. in most of skills.

edit: going to do some updates a bit later

(*
useActionKey
-------------

function useActionKey(KeyPossition:string):boolean;


Example: useActionKey('1'); // Will use first slot of action bar.

Available options are ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '='] //returns true, if none of these, returns false

by Laimonas171

*)
function useActionKey(KeyPossition:string):boolean;
begin
Case KeyPossition of
'1': begin
TypeSendEx('1',False);
result := true;
end;
'2': begin
TypeSendEx('2',False);
result := true;
end;
'3': begin
TypeSendEx('3',False);
result := true;
end;
'4': begin
TypeSendEx('4',False);
result := true;
end;
'5': begin
TypeSendEx('5',False);
result := true;
end;
'6': begin
TypeSendEx('6',False);
result := true;
end;
'7': begin
TypeSendEx('7',False);
result := true;
end;
'8': begin
TypeSendEx('8',False);
result := true;
end;
'9': begin
TypeSendEx('9',False);
result := true;
end;
'0': begin
TypeSendEx('0',False);
result := true;
end;
'-': begin
TypeSendEx('-',False);
result := true;
end;
'=': begin
TypeSendEx('=',False);
result := true;
end;
else
result := false;
end;
end;

Ian
11-20-2012, 02:17 PM
Nice, good job. Position has one s though :)

riwu
11-20-2012, 02:17 PM
TypeByte may be more appropriate.
Also you can just do TypeByte(VK_1), TypeByte(VK_2) so it's like kind of 1 liner procedure, not sure if it'll be useful :S
The Boolean result it returns isn't too meaningful too.

Laimonas171
11-20-2012, 02:19 PM
TypeByte may be more appropriate.
Also you can just do TypeByte(parameter of virtual keys) so it's like 1 liner procedure.
The results here aren't too meaningful though.

yeah but but though if you do "mistake" etc keyboard patern will be not en but LT (in my case) = becomes ž.. and that will gives back false. because it's not one of action bar keys... also misclick may happen like = can be [] or sth around it :D

edit: yeah i might use typeByte, but not a big deal i guess? isn't?

Mr[S]
11-20-2012, 02:23 PM
Will everyone be adding this to their own scripts?

Ian
11-20-2012, 02:25 PM
;1129938']Will everyone be adding this to their own scripts?

If it's added to srl then we won't need to. If it isn't then we could add it to our own (with credits of course)

Laimonas171
11-20-2012, 02:28 PM
;1129938']Will everyone be adding this to their own scripts?

unnecessary, but I will becouse it will be easy to do things, and most of legit player going to use it, becouse it's easier then do thing around tabs.

example. You can use magic.
You can put superheat at 4 slot (any)
http://i.imgur.com/I30xW.png

and
useActionKey('4'); //superheat if you have runes etc

will use superheat magic, after that you can find item in invetory and superheat it.

Also you use
useActionKey('1'); //gold ore, select item in inventory if exist
and then click on furnace...

litoris
11-20-2012, 04:34 PM
This is kinda useless, you can re-define keys.