CLEO Help Activation key in cleo, Help!

CLEO related
Status
Not open for further replies.

Dragtx

Member
Joined
Jun 3, 2020
Messages
15
Reaction score
0
Location
Colombia
Greetings, I make this post to see if anyone can help me by placing an on / off key for a cleo, thank you very much.

To see if it is possible to activate with F11 and deactivate with F12.

Code:
{$CLEO .cs}

THREAD 'LAG.CS'

0662: printstring "Original concept by SpexxTr0n"
0662: printstring "Improved by Zin"

WHILE TRUE
    WAIT 0
    
    IF
        056D:   actor $PLAYER_ACTOR defined
    THEN
        32@ = 0 // timer in ms
        WHILE 82A0:   actor $PLAYER_ACTOR stopped // actor moving
            WAIT 0
            IF AND
                32@ >= 0
                32@ <= 1000
            THEN
                02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 0 EP 0 CP 0 MP 0
            ELSE
                IF AND
                    32@ >= 1000
                    32@ <= 2000  //estaba en 5000
                THEN
                    02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
                END     
            END
            IF
                32@ >= 2000
            THEN
                BREAK
            END
        END
        02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
    END
    
END
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
Greetings, I make this post to see if anyone can help me by placing an on / off key for a cleo, thank you very much.

To see if it is possible to activate with F11 and deactivate with F12.

Code:
{$CLEO .cs}

THREAD 'LAG.CS'

0662: printstring "Original concept by SpexxTr0n"
0662: printstring "Improved by Zin"

WHILE TRUE
    WAIT 0
   
    IF
        056D:   actor $PLAYER_ACTOR defined
    THEN
        32@ = 0 // timer in ms
        WHILE 82A0:   actor $PLAYER_ACTOR stopped // actor moving
            WAIT 0
            IF AND
                32@ >= 0
                32@ <= 1000
            THEN
                02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 0 EP 0 CP 0 MP 0
            ELSE
                IF AND
                    32@ >= 1000
                    32@ <= 2000  //estaba en 5000
                THEN
                    02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
                END    
            END
            IF
                32@ >= 2000
            THEN
                BREAK
            END
        END
        02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
    END
   
END

Code:
{$CLEO .cs}

THREAD 'LAG.CS'

0662: printstring "Original concept by SpexxTr0n"
0662: printstring "Improved by Zin and ajom"

const
    KEY_ACTIVE = 122 // F11
    KEY_DEACTIVE = 123 // F12
end

WHILE TRUE
    WAIT 0
    IF 0AB0:   key_pressed KEY_ACTIVE
    THEN
        REPEAT
            wait 0
            IF 056D:   actor $PLAYER_ACTOR defined
            THEN
                32@ = 0 // timer in ms
                WHILE 82A0:   actor $PLAYER_ACTOR stopped // actor moving
                    WAIT 0
                    IF AND
                        32@ >= 0
                        32@ <= 1000
                    THEN 02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 0 EP 0 CP 0 MP 0
                    ELSE
                        IF AND
                            32@ >= 1000
                            32@ <= 2000  //estaba en 5000
                        THEN 02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
                        END     
                    END
                    IF OR
                        32@ >= 2000
                        0AB0:   key_pressed KEY_DEACTIVE
                    THEN BREAK
                    END
                END
                02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
            END
        UNTIL 0AB0:   key_pressed KEY_DEACTIVE
    END
END
 
Status
Not open for further replies.
Top