CLEO Help end help

CLEO related
Status
Not open for further replies.

MexikanoS

Member
Joined
Mar 9, 2014
Messages
7
Reaction score
0
Hiho. I'm trying to write a simple fishing bot, that will be enabled/disabled within F10 button. If the cheat is activated it'll send fake key -> enter, and then about 100 instances of space presses. Now the problem is I get "Unknown directive end.", and I preety much don't have a clue on how it should look like in cleo. May some1 look into my code and point me out what should I do? Thx.

Code:
{$CLEO}
	0000:

:START
wait 0
	if 0AB0: key_down 121 then // F10
		0B12: 32@ = 0@ XOR 1
		if 32@ == 0
			0AD1: show_formatted_text_highpriority "Enabled Fishing Bot" time 2000
		end
		if 32@ == 1
			0AD1: show_formatted_text_highpriority "Disabled Fishing Bot" time 2000
        end
    end
    if 32@ == 1 then
		jump @FISHER
	end
jump @START

:FAKE_KEYPRESS
2@ = 0xB73458
	005A: 2@ += 0@
	0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0
	0AB2: ret 0
	
:FISHER
wait 0
if 32@ == 1 then
	wait 20
	0AB1: @FAKE_KEYPRESS 2 _OFFSET_KEY_ 0x0D val 255
	wait 15
	0AB1: @FAKE_KEYPRESS 2 _OFFSET_KEY_ 0x0D val 0
	wait 15
	0AB1: @FAKE_KEYPRESS 2 _OFFSET_KEY_ 0x20 val 255
	wait 12
	0AB1: @FAKE_KEYPRESS 2 _OFFSET_KEY_ 0x20 val 0
	wait 15
	0AB1: @FAKE_KEYPRESS 2 _OFFSET_KEY_ 0x20 val 255
	wait 12
	0AB1: @FAKE_KEYPRESS 2 _OFFSET_KEY_ 0x20 val 0
	wait 15
	// and so on..
	jump @START
 

4changesLeft

Well-known member
Joined
Apr 10, 2015
Messages
365
Reaction score
3
Haha nvm what I said. My question is, you want the space to be pressed 100 times, rapidly? or like 1 time per second
 

MexikanoS

Member
Joined
Mar 9, 2014
Messages
7
Reaction score
0
No, about the press itself - it's all working great. The only problem is that I wanted to make the code a little bit more "professional". So I've tried to add the enable/disable thingie, but now, when the code looks like this, Sanny Builder tells me this..:

c6135183b7.png


And I've no idea, what's wrong with my code..

I'm just trying to code something easy in Cleo, and I've never tried this lang before. I'm familiar with the coding structures of C related languages, but it's my first attempt to code something in cleo, so I'm preety much like - wtf is going on here ^^
 

4changesLeft

Well-known member
Joined
Apr 10, 2015
Messages
365
Reaction score
3
OK, first of all, jumping on another function is just making the script bigger and harder to get it right. Secondly, you had some tiny mistakes, solved them, you can try this, it's working fine.

Code:
{$CLEO}
    0000:

:START
wait 0
    if 
    key_down 121 
    then
        0B12: 0@ = 0@ XOR 1
        if 
        0@ == 1
        then
            0AD1: show_formatted_text_highpriority "Enabled Fishing Bot" time 1500
            //code
            wait 500
            else
            0AD1: show_formatted_text_highpriority "Disabled Fishing Bot" time 1500
            wait 500
       end
   end
jump @START

:FAKE_KEYPRESS
2@ = 0xB73458
005A: 2@ += 0@
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0
0AB2: ret 0


I meant label not function xd sorry haha i'm tired
 

MexikanoS

Member
Joined
Mar 9, 2014
Messages
7
Reaction score
0
Well the thing is, that I wanted to keep the script this way: when I press the key, of value 121, it will set the variable 31@ to 0 if it's 1 and vice versa. Now if it's 1, the script will spam enter and +/- 100 instances of spaces all the time (until I'll disable the script), but lemme try to do something with your code. Thank you very much.
 
Status
Not open for further replies.
Top