CLEO Help Need simple help with sannyBuilder

CLEO related
Status
Not open for further replies.

MichaelScott

Member
Joined
Apr 29, 2019
Messages
15
Reaction score
0
Hello, I have just started learning to script with SannyBuilder and i ran into some problems that i can't find any fixes to it. Here is the code:
Code:
{$CLEO .cs}

0000: NOP

thread 'snippet'

:label_1
wait 0
if 0AB0: key_pressed 106
then 0AF9: "/fish"
    0AD1: show_text "Started fishing" time_in_ms 2000
    wait 1000
    jump @label_1
else jump @label_1
end

First of all, whenever i press the multiply button - *, it should write command /fish in chat, but instead i get error in chat: Exception 0x000005 0x0, something like that.
Also, I can't find how to make the cleo script press any button, because I will need it later. For example it should spam ENTER button for 5 seconds.
Any help is appreciated.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
PHP:
{$CLEO .cs}

0000: NOP

wait 10000

while true
wait 0

if 
0AB0: 106
then 
    0AF9: "/fish"
    0AD1: show_text "Started fishing" time_in_ms 2000
    wait 1000
end

end
 

MichaelScott

Member
Joined
Apr 29, 2019
Messages
15
Reaction score
0
Explain about system , take pic or video.
Okay, I can't give you a pic, but it is very simple. You start fishing with /fish and texdraw appears that says "Fishing". After 25-35 seconds (time is random) it changes to "Repeatedly press ENTER to catch a fish" and a line which fills when you press ENTER. I need the script to automatically press ENTER when the texdraw changes from the first one to the second one.
 

MichaelScott

Member
Joined
Apr 29, 2019
Messages
15
Reaction score
0
I really can't take a video right now... I dont know how to explain this, basically just one texdraw changes its text and i need to find when it does it.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
I really can't take a video right now... I dont know how to explain this, basically just one texdraw changes its text and i need to find when it does it.
OK.
1. Server ip?
2. Which samp version server use?
3. You use sampfuncs?
4. Create acc for testing.
5. Make sure that acc have everything for fishing.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
1. Read Forum rules...
2. It's a GameText.
PHP:
{$CLEO .cs}
{$INCLUDE SF}
 
0000: NOP
 
0BE3: raknet setup_incoming_rpc_hook @IncomingRPC
30@ = 0
31@ = 0
29@ = 0

:main
wait 0
if and
key_down 49 // 1
key_down 74 // J
then
    if
    31@ == 0
    then
        31@ = 1
        0AF8: "{FFFFFF}Logger: {00FF33}Enabled" 1
    else
        31@ = 0
        0AF8: "{FFFFFF}Logger: {FF0000}Disabled" 1
    end
    wait 1000
end
if
30@ == 1
then
    if
    31@ == 1
    then
        //// send key press
        30@ = 0
        29@ = 0
    else
        31@ = 0
        30@ = 0
    end
end
jump @main
 
 
 
:IncomingRPC
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if and
0@ == RPC_SCRDISPLAYGAMETEXT // GameText
31@ == 1
29@ == 0
then
    0BE5: raknet 1@ = get_hook_param PARAM_BITSTREAM
    //ignore gamtext style and time (8bytes = 64bits)
    0BEB: raknet bit_stream 1@ ignore_bits 64
    //read text length                                    
    0BE7: raknet 2@ = bit_stream_read 1@ type BS_TYPE_INT 
    //allocate text length + 1 for null terminating char   
    0A8E: 3@ = 2@ + 1 
    alloc 4@ = 3@ 
    //clear buffer, make sure last char is 0
    0C11: memset 4@ value 0 size 3@ 
    //read to buffer with size
    0BE8: raknet bit_stream 1@ read_array 4@ size 2@ 
    chatmsg "GameText: %s" -1 4@
    /*if
    0C14: strcmp string1 4@ string2 "~n~~r~|~r~~h~|~y~~h~|~y~|~g~~h~|~g~|"
    then
        0AF8: "{FFFFFF}Auto Fisher: {FFFF00}Retrieving Rod" 1
        0AB1: @FAKE_KEYPRESS 1 _OFFSET_KEY_ 0x8
        30@ = 1
        29@ = 1
    end      */
    free 4@
end
0BE0: raknet hook_ret true
 
Status
Not open for further replies.
Top