CLEO Help Convert this lua script to cleo

CLEO related

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
Someone convert this lua to cleo script ?
CSS:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage("[{fd3737}Infamous Mods{FFFFFF}] са заредени.", -1)
    sampAddChatMessage("[{fd3737}Auto-Fish & Putback{FFFFFF}] /afish", -1)
    sampRegisterChatCommand("afish", active)
    active = false
    while true do
    wait(0)
        if active then
            sampSendChat("/fish")
            wait(12500)
            sampSendChat("/putallback")
            wait(100)
        end
    end
end

function active()
    if active == true then
        active = false
        sampAddChatMessage("[Auto Fishing] - {fd3737}OFF{FF0000}", -1)
    else
        active = true
        sampAddChatMessage("[Auto Fishing] - {20b61f}ENABLED{00FF00}", -1)
        sampAddChatMessage("Ти започна да ловиш риба, за да спреш напиши /afish", -1)
    end
end

function sampev.onServerMessage(clr, msg)
  if msg:find("Не е изминало нужното време от последното използване на командата!") and active then
      active = false
      sampAddChatMessage("[{fd3737}Auto-Heal{FFFFFF}] Скрипта е изключен, защото не е изтекло времето. ‡а активациЯ отново /aheal.", -1)
  end
end
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Someone convert this lua to cleo script ?
CSS:
require 'lib.moonloader'
local sampev = require 'lib.samp.events'

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage("[{fd3737}Infamous Mods{FFFFFF}] са заредени.", -1)
    sampAddChatMessage("[{fd3737}Auto-Fish & Putback{FFFFFF}] /afish", -1)
    sampRegisterChatCommand("afish", active)
    active = false
    while true do
    wait(0)
        if active then
            sampSendChat("/fish")
            wait(12500)
            sampSendChat("/putallback")
            wait(100)
        end
    end
end

function active()
    if active == true then
        active = false
        sampAddChatMessage("[Auto Fishing] - {fd3737}OFF{FF0000}", -1)
    else
        active = true
        sampAddChatMessage("[Auto Fishing] - {20b61f}ENABLED{00FF00}", -1)
        sampAddChatMessage("Ти започна да ловиш риба, за да спреш напиши /afish", -1)
    end
end

function sampev.onServerMessage(clr, msg)
  if msg:find("Не е изминало нужното време от последното използване на командата!") and active then
      active = false
      sampAddChatMessage("[{fd3737}Auto-Heal{FFFFFF}] Скрипта е изключен, защото не е изтекло времето. ‡а активациЯ отново /aheal.", -1)
  end
end
PHP:
{$CLEO .cs}

0000: 'Author: Parazitas | UGBASE.EU'

REPEAT
WAIT 0
UNTIL 0AFA:

0B34: samp register_client_command "afish" to_label @CMD

0AF8: samp add_message_to_chat  "[{FD3737}Infamous Mods{FFFFFF}] ?? ????????." color -1
0AF8: samp add_message_to_chat  "[{FD3737}Auto-Fish & Putback{FFFFFF}] /afish" color -1

WHILE TRUE
    WAIT 0 
    
IF 0256:   player $PLAYER_CHAR defined
THEN 
    IF 31@ == TRUE
    THEN
        IF 30@ == FALSE
        THEN
            0C8F: samp process_chat_input "/fish"
            30@ = TRUE
        END
        IF 30@ == TRUE
        THEN
            IF 32@ > 12500 // 12.5 sec
            THEN
                0C8F: samp process_chat_input "/putallback"
                32@ = 0
                30@ = FALSE
            END
        END
    END
END

END



:CMD
IF 31@ == FALSE
THEN
    31@ = TRUE
    0AF8: samp add_message_to_chat  "[Auto Fishing] - {20B61F}ENABLED{00FF00}" color -1
    0AF8: samp add_message_to_chat  "?? ??????? ?? ????? ????, ?? ?? ????? ?????? /afish" color -1
ELSE
    31@ = FALSE
    30@ = FALSE
    0AF8: samp add_message_to_chat  "[Auto Fishing] - {FD3737}OFF{FF0000}" color -1
END
0B43: samp cmd_ret
 

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
PHP:
{$CLEO .cs}

0000: 'Author: Parazitas | UGBASE.EU'

REPEAT
WAIT 0
UNTIL 0AFA:

0B34: samp register_client_command "afish" to_label @CMD

0AF8: samp add_message_to_chat  "[{FD3737}Infamous Mods{FFFFFF}] ?? ????????." color -1
0AF8: samp add_message_to_chat  "[{FD3737}Auto-Fish & Putback{FFFFFF}] /afish" color -1

WHILE TRUE
    WAIT 0
   
IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 31@ == TRUE
    THEN
        IF 30@ == FALSE
        THEN
            0C8F: samp process_chat_input "/fish"
            30@ = TRUE
        END
        IF 30@ == TRUE
        THEN
            IF 32@ > 12500 // 12.5 sec
            THEN
                0C8F: samp process_chat_input "/putallback"
                32@ = 0
                30@ = FALSE
            END
        END
    END
END

END



:CMD
IF 31@ == FALSE
THEN
    31@ = TRUE
    0AF8: samp add_message_to_chat  "[Auto Fishing] - {20B61F}ENABLED{00FF00}" color -1
    0AF8: samp add_message_to_chat  "?? ??????? ?? ????? ????, ?? ?? ????? ?????? /afish" color -1
ELSE
    31@ = FALSE
    30@ = FALSE
    0AF8: samp add_message_to_chat  "[Auto Fishing] - {FD3737}OFF{FF0000}" color -1
END
0B43: samp cmd_ret
Thank you
 
Top