Script that auto-kicks a "spoofer"

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
risker
Forum Staff
Posts: 351
Joined: June 8th, 2008, 3:05 am
Location: Australia

Script that auto-kicks a "spoofer"

Post by risker »

Basically, I want particular usernames to be password locked. They have to say the password within ten seconds of the map starting, or they'll be kicked for not authenticating themselves.
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Script that auto-kicks a "spoofer"

Post by naturesfury »

make a timer single event at like 10 sec (i'd wait for like 30 or something as some people lag...)

function exampleaction takes nothing returns nothing
local integer i=0
local boolean var=true
loop
exitwhen i>11
if GetPlayerName(Player(i))=="whateverusername" and not var then
call CustomDefeatBJ(Player(i),"Die spoofer!! or whatever")
endif
set i=i+1
endloop
endfunction

copy from if to endif with a diff username/message for every diff username
then another trigger to set that variable. you can set the variable to whatever you want when they authenticate, just used true in the example
User avatar
haxorico
Super Moderator
Posts: 3197
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND
Been thanked: 1 time

Re: Script that auto-kicks a "spoofer"

Post by haxorico »

Under globals
Spoiler:

Code: Select all

constant string PASSWORD="i am not a spoofer"
constant real TIME_TO_WAIT=10.0
trigger trgChat=CreateTrigger()
boolean array users
Under endglobals
Spoiler:

Code: Select all

function kickSpoofers takes nothing returns nothing
local integer i=0
loop
exitwhen i>11
if users[i] then
call CustomDefeatBJ(Player(i),"Don't spoof my name.")
endif
set i=i+1
endloop
call DisableTrigger(trgChat)
call DestroyTrigger(trgChat)
endfunction

function authorizeUser takes nothing returns nothing
set users[GetPlayerId(GetTriggerPlayer())]=false
endfunction

function isUserNameSaved takes integer playerNumber returns boolean
local string s=StringCase(GetPlayerName(Player(playerNumber)),false)
if (s=="admin1") or (s=="admin2") or (s=="admin3") then
set s=""
return true
endif
set s=""
return false
endfunction

function checkSpoof takes nothing returns nothing
local integer i=0
loop
exitwhen i>11
call TriggerRegisterPlayerChatEvent(trgChat,Player(i),PASSWORD,false)
set users[i]=isUserNameSaved(i)
set i=i+1
endloop
call TriggerAddAction(trgChat,function authorizeUser)
call TriggerSleepAction(TIME_TO_WAIT)
call kickSpoofers()
endfunction
under function main

Code: Select all

call checkSpoof()
I didn't test it, but it should work.
Image
Spoiler:
(02:24:09)

Code: Select all

ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).

Code: Select all


(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac: 

Code: Select all

(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code: Select all

(15:42:51) Lanaya: can i suck , . . .

Code: Select all

(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code: Select all

GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code: Select all

(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).

Code: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Script that auto-kicks a "spoofer"

Post by naturesfury »

LOL nice,
forget mine, use his xP
User avatar
risker
Forum Staff
Posts: 351
Joined: June 8th, 2008, 3:05 am
Location: Australia

Re: Script that auto-kicks a "spoofer"

Post by risker »

I put this together;

Code: Select all


function Trig_Antispoof1_Func001001001001 takes nothing returns boolean
    return ( GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_USER )
endfunction

function Trig_Antispoof1_Func001001001002 takes nothing returns boolean
    return ( GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING )
endfunction

function Trig_Antispoof1_Func001001001 takes nothing returns boolean
    return GetBooleanAnd( Trig_Antispoof1_Func001001001001(), Trig_Antispoof1_Func001001001002() )
endfunction

function Trig_Antispoof1_Func001Func001C takes nothing returns boolean
    if ( not ( GetPlayerName(GetEnumPlayer()) == "risker[MN]" ) ) then
        return false
    endif
    return true
endfunction

function Trig_Antispoof1_Func001A takes nothing returns nothing
    if ( Trig_Antispoof1_Func001Func001C() ) then
    else
    endif
endfunction

function Trig_Antispoof1_Actions takes nothing returns nothing
    call ForForce( GetPlayersMatching(Condition(function Trig_Antispoof1_Func001001001)), function Trig_Antispoof1_Func001A )
endfunction

//===========================================================================
function InitTrig_Antispoof1 takes nothing returns nothing
    set gg_trg_Antispoof1 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Antispoof1, function Trig_Antispoof1_Actions )
endfunction


function Trig_password_part_2_Func001Func001001001 takes nothing returns boolean
    return ( GetPlayerName(GetTriggerPlayer()) == "risker[MN]" )
endfunction

function Trig_password_part_2_Func001C takes nothing returns boolean
    if ( not ( GetEventPlayerChatString() == "Hai" ) ) then
        return false
    endif
    return true
endfunction

function Trig_password_part_2_Actions takes nothing returns nothing
    if ( Trig_password_part_2_Func001C() ) then
        call DisplayTextToForce( GetPlayersMatching(Condition(function Trig_password_part_2_Func001Func001001001)), "TRIGSTR_004" )
    else
        call QueuedTriggerRemoveBJ( GetTriggeringTrigger() )
        call QueuedTriggerAddBJ( GetTriggeringTrigger(), true )
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_001" )
    endif
endfunction

//===========================================================================
function InitTrig_password_part_2 takes nothing returns nothing
    set gg_trg_password_part_2 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_password_part_2, function Trig_password_part_2_Actions )
endfunction
Kyoshiro
Forum Staff
Posts: 762
Joined: October 27th, 2009, 12:18 pm
Location: Australia, GMT+8

Re: Script that auto-kicks a "spoofer"

Post by Kyoshiro »

Code: Select all

function Trig_Antispoof1_Func001A takes nothing returns nothing
    if ( Trig_Antispoof1_Func001Func001C() ) then
    else
    endif
endfunction
what?
If you have any questions drop in by chat sometime, chances are there'll be someone who can help you that's afking there, so the next best thing is to click the link on UndeadxAssassin's Sig and ask your question there.
User avatar
risker
Forum Staff
Posts: 351
Joined: June 8th, 2008, 3:05 am
Location: Australia

Re: Script that auto-kicks a "spoofer"

Post by risker »

Something tells me thats missing something. *rubshead*

Oh and I forgot the thing to trigger it. ^_^

Code: Select all

function Trig_trigger_Actions takes nothing returns nothing
    call TriggerExecute( gg_trg_Antispoof1 )
endfunction

//===========================================================================
function InitTrig_trigger takes nothing returns nothing
    set gg_trg_trigger = CreateTrigger(  )
    call TriggerAddAction( gg_trg_trigger, function Trig_trigger_Actions )
endfunction
User avatar
haxorico
Super Moderator
Posts: 3197
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND
Been thanked: 1 time

Re: Script that auto-kicks a "spoofer"

Post by haxorico »

I think you forgot to add the globals.

gg_trg_trigger=null
gg_trg_Antispoof1=null
gg_trg_password_part_2=null

and all the TRIGSTR_XXX are saved in the war3map.wts file, so that data is missing also.
Image
Spoiler:
(02:24:09)

Code: Select all

ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).

Code: Select all


(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac: 

Code: Select all

(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code: Select all

(15:42:51) Lanaya: can i suck , . . .

Code: Select all

(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code: Select all

GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code: Select all

(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).

Code: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?
User avatar
risker
Forum Staff
Posts: 351
Joined: June 8th, 2008, 3:05 am
Location: Australia

Re: Script that auto-kicks a "spoofer"

Post by risker »

I think I'll just go with your script. :P

EDIT:

Also, instead of a typical defeat. I was thinking of using the

Code: Select all

Trigger - Remove (This trigger) from the trigger queue
Trigger - Add (This trigger) to the trigger queue (Checking conditions)
to cause the game to crash, making them alt+f4 but I believe that'd crash everyone and not just the particular player?
User avatar
haxorico
Super Moderator
Posts: 3197
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND
Been thanked: 1 time

Re: Script that auto-kicks a "spoofer"

Post by haxorico »

I never checked crushing mechanics because I found one that is just the coolest, but that is kept for me, mainly cause its just funny, but it crashes for everyone :O
Image
Spoiler:
(02:24:09)

Code: Select all

ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).

Code: Select all


(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac: 

Code: Select all

(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code: Select all

(15:42:51) Lanaya: can i suck , . . .

Code: Select all

(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code: Select all

GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code: Select all

(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).

Code: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?