CLEO Help I need help making a cleo to "scramble" words

CLEO related
Status
Not open for further replies.

404exe

New member
Joined
Aug 3, 2017
Messages
4
Reaction score
0
I'm new on this SannyBuild stuff and I was wondering if someone could help me making a cleo to scramble the words you type. For example doing "/u sthkan" you'll get a thingy on your chatbox saying "thanks." If you can't redirect the cleo to search these letters in a webpage then it would be cool if you could make a list with words in the .cs and it unscrambles them by doing /u, so you just write words in the cleo file and in-game if you write them after "/u (LETTERS)" it'll pop up how you write the word in your chatbox. If you help me it's up to you if you want me to keep the cleo private.
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
IDK but if anyone wants to try it:

UrlDownloadFile with the scrambled word:
http://www.allscrabblewords.com/unscramble/sthkan

Then scan the file for the result and display it in the chat ^^
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
I tried it and it is actually working very well! This script is only a version to see if it actually works, so dont expect some string operations to show you the result directly:
unscramble.png


PHP:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY
0B34: "unscramble" @unscramble

WHILE TRUE
    WAIT 0
    IF
    31@ == TRUE
    THEN
        0AF8: "[00]TEST BY www.UGBASE.eu | Opcode.eXe !" -1 
        0AF8: "[01]Unscramble the Word: %s" -1 1@v
        0AC8: 6@ = allocate_memory_size 640

        0AD3: 6@ = format "http:%c%cwordunscrambler.net%c?word=%s" 0x2F 0x2F 0x2F 1@v
        0AF8: "[02]Downloading the Page: %s" -1 6@
        0C65: 10@ = download_url 6@ to_file "scramble.php"
        11@ = -1
        WHILE 11@ == -1 
            WAIT 0
            0C66: 11@ = get_download 10@ state
        END
        0C7D: release_download 10@
        0AF8: "[03]Downloading finished." -1 


        0AF8: "[04]Opening our file scramble.php" -1 

        WHILE 8A9A: 30@ = openfile "scramble.php" mode "rt" // IF and SET 
            WAIT 0
        END
        0AF8: "[05]scramble.php opened!" -1 
        
        0AC8: 12@ = allocate_memory_size 1024
        
        29@ = false
        
        repeat
        if
        0AD7: read_string_from_file 30@ to 12@ size 1024 // IF and SET
        then
            0AC8: 13@ = allocate_memory_size 1024
            0AC8: 14@ = allocate_memory_size 1024
            0AD3: 13@ = format "Exact Match Words"
        
            IF
            0C18: 14@ = strstr string1 12@ string2 13@
            THEN
                0AD7: read_string_from_file 30@ to 12@ size 1024 // IF and SET   //skip 2 lines xD cuz lazy u know
                0AD7: read_string_from_file 30@ to 12@ size 1024 // IF and SET
                0AF8: "[06]Look for the unscrambled word here:" -1 
                0AF8: "%s" -1 12@ 
            END
            0AC9: free_allocated_memory 13@
            0AC9: free_allocated_memory 14@
        end
        until 0AD6:   end_of_file 30@ reached
        0A9B: closefile 30@




         
        0AC9: free_allocated_memory 12@
        0AC9: free_allocated_memory 6@
        31@ = 0
    END
END





:unscramble
0B35: samp 0@ = get_last_command_params
IF
0AD4: 33@ = scan_string 0@ "%s" 1@v
THEN
    31@ = TRUE
END
0B43: samp cmd_ret
 

404exe

New member
Joined
Aug 3, 2017
Messages
4
Reaction score
0
Whenever I go IG my SAMP crashes, what version of SAMPFUNCS do I need to get this working? Can you link me it please?
 

404exe

New member
Joined
Aug 3, 2017
Messages
4
Reaction score
0
The problem is my computer? Don't be lazy and find it?
I tried it with two computers I think and also HIS SCRIPT MIGHT BE THE ONE NOT WORKING. Since I got a bunch of SAMPFUNCS and this CLEO didn't work.
 
Status
Not open for further replies.
Top