SRL Archive - General Botting Help

Weird bug: SendKeys('''', ...) moving compass right in foreign worlds


riwu

2015-01-31 01:35:00

In France/Brazil servers, doing the following:

SendKeys('''', 30 + Random(30), 30 + Random(30)); //types single quote '
Will rotate the compass to the right slightly. It doesn't happen in English/German servers, nor does it happen when u type ' manually or call TypeByte(VK_OEM_7).
I checked https://github.com/MerlijnWajer/Simba/blob/65480539458130e559999f99d28046a186f10f10/Units/MMLCore/os_windows.pas#L481, cant find anything unusual.

Can anyone duplicate this or it's just me?

Brandon

2015-01-31 13:43:44

This is NOT a bug.. Just bad programming. SendKeys assumes that all characters in a string can be mapped to the ASCII table codes. Which is wrong.


Some keys are called NON-MAPPABLE Virtual Key Codes (http://www.kbdedit.com/manual/low_level_vk_list.html)..

VK_OEM7 aka 0xDE or 222 = For the US standard keyboard, the 'single-quote/double-quote' key

https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx


SMART uses VirtualKey codes.. NOT ASCII codes. Just because a few virtual keycodes "MAP" with their ASCII equivalent, does not mean that all of them do.. Hence "Non-Mappable". This usually causes programmers that do not know, lots of problems.. This is where SendKeys fails..


JavaScript is the perfect example: http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes



SMART: https://github.com/BenLand100/SMART/blob/master/src/EventNazi.java#L452


And yes, it "can" work on English servers because ASCII is the "American" Standard Code for Information.. That does not make it "Universal". Also does not mean that it will work on all English applications or servers either.

We tend to assume that all keys are mappable. Bad practice.



//Virtual Key Codes:

//37 = left. 0x25
//38 = up. 0x26
//39 = right. 0x27 -- 39 in the ASCII table is single-quote. But NOT in the VKC table.
//40 = down. 0x28