CLEO Help Auto LMB at specific coordinates

CLEO related
Status
Not open for further replies.

AidanGucci

Active member
Joined
Sep 19, 2017
Messages
98
Reaction score
8
Sorry for posting here but since nobody had replied to my request in the Collection thread.

It's a very simple modification and wouldn't take more than 5 minutes

* Name of the mod (if the mod doesn't exist, you don't have to tell one): Auto keypress at specific coordinates
* Where you saw it (not the server, we mean if you saw any videos/screenshots about it or not): N/A
* What do you want (the most important part, explain this carefully): Need LMB auto keypress at specific coordinates
* Details (add more details to your request): Just script me LMB auto press at specific coordinates. I'll edit the coordinates myself. It must spam LMB when it reaches a specific coordinates
* On/off key (specify it): /min
 

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
PHP:
while true
    wait 0
    00A0: store_actor $PLAYER_ACTOR positon_to 1@ 2@ 3@ //Stores players position
    050A: 0@ = distance_between_XYZ 1509.3781 -1667.6798 14.0469 1@ 2@ 3@ //Get distance between player and point (returns float)
    
    //Uncomment below to have distance printed to chat, use this for testing range
    //chatmsg "%f" -1 0@
    
    if
        8021: not 0@ > 2.0 //This is a very small distance, you can play around with it
    then
        if
            8B21: not samp is_chat_opened  //Won't send the keypress if you're typing something.
        then    
            0AB1: send_keypress @keyPress 2 key 96 time 100 //Keycode 96 as this is one of the default keybinds for the "Fire" key in GTA. Can't send Left mouse clicks using this method.
            //Keypress function credits go to Opcode.eXe
        end
    end
end

:keyPress
// 0@ - key, 1@ - time
// Example: 0AB1: call @keyPress 2 key 0@ time 1@
if 0AA2: 2@ = load_library "User32.dll"
then
    if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
    then
        0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
        wait 1@
        0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
    end
end
0AB2: ret 0

Requires SAMPFUNCS.
Not really anyway of making the player stay still while punching, so you'll need to move the mouse around to keep the player in one place.
 
Status
Not open for further replies.
Top