Auto Fishing Captcha

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Xodek

Member
Feb 28, 2024
1
0
1
21
Hello, I am trying to make an anti-autofishing captcha.
The code works - almost. The only issue I am having is when a player types in the CORRECT captcha they are being kicked regardless.
Could anyone help with this and tell me where I am going wrong? I am using skRay and MundoSK.
Code:
on script load:

    delete {aaf.location::*}
    delete {aaf.infractions::*}

on fish:

    set {_p::synergy} to 1
    set {_p::ynergys} to 2
    set {_p::nergysy} to 3
    set {_p::ergysyn} to 4
    set {_p::rgysyne} to 5
    set {captcha.verify} to random from {_p::*} probs
    
    if {aaf.location::%event-player%} is not set:
        set {aaf.location::%event-player%} to event-player's location
      
    else if {aaf.location::%event-player%} = event-player's location:
        add 1 to {aaf.infractions::%event-player%}

        if {aaf.infractions::%event-player%} >= 50:
            delete {aaf.infractions::%event-player%} 
            delete {aaf.location::%event-player%}
            send player title {captcha.verify} with subtitle "&c&lPlease type this Captcha in chat" for 15 seconds
            set {captcha.status} to 1
            
    else if {aaf.location::%event-player%} != event-player's location:
        delete {aaf.infractions::%event-player%}
        delete {aaf.location::%event-player%}
        delete {captcha.verify}
        delete {captcha.status}
        stop
        
on chat:
    if {captcha.status} is equal to 1:
        cancel event
        
        if message contains {captcha.verify}:
            message "&a&lCaptcha Complete"
            delete {captcha.verify}
            delete {captcha.status}
        
        else:
            cancel event
            kick event-player due to "AFK-Fishing is not allowed"
            delete {captcha.verify}
            delete {captcha.status}
        
On fish:
    if {captcha.status} is equal to 1:
        wait 30 seconds
        if {captcha.status} is equal to 1:
            kick event-player due to "AFK-Fishing is not allowed"
            delete {captcha.verify}
            delete {captcha.status}
 
Could you try deleting this section:
Code:
set {_p::synergy} to 1
    set {_p::ynergys} to 2
    set {_p::nergysy} to 3
    set {_p::ergysyn} to 4
    set {_p::rgysyne} to 5
    set {captcha.verify} to random from {_p::*} probs
and instead, use:
Code:
set {captcha.verify} to random integer between 1 and 5
I also think you need to change
Code:
if message contains {captcha.verify}:
to this:
Code:
if message contains "%{captcha.verify}%":
but with that, I might be wrong.