AssaultCube Italia Forum

Vuoi reagire a questo messaggio? Crea un account in pochi click o accedi per continuare.

    [SCR] AFK-Script

    Andrez
    Andrez
    Admin


    Clan : AC/DC
    Messaggi : 168
    Data d'iscrizione : 04.08.10
    Età : 32
    Località : Sicilia

    [SCR] AFK-Script Empty [SCR] AFK-Script

    Messaggio  Andrez Dom 08 Mag 2011, 17:45

    //AFK Script
    //by CiD
    //Questo script aggiungerà "|afk" accanto al vostro nickname quando siete inattivi per un certo periodo di tempo
    //TODO: make a settings menu
    //User Settings
    //This is what will be added to your name when you are AFK.
    afkstr = "|afk"

    //If set to 1, it will display a message to other players when you go AFK. Set to 0 to disable.
    afkshowmessage = 1

    //This will be placed after your name and sent to other players.
    afkmessage = "is no longer available."

    //This is how long (in seconds) the script will wait if you are idle before changeing you to AFK.
    timeuntilafk = 20

    //DO NOT EDIT BELOW HERE
    curafk = 0
    afktime = 0
    alias afk [
    if $arg1 [
    if (= $curafk 0) [
    oldname = $curname
    name (concatword $oldname $afkstr)
    curafk = 1
    echo "You are now set to: AFK"
    if $afkshowmessage [say (concat "AFKScript:" $oldname $afkmessage )]
    ]
    ] [
    if $curafk [
    name $oldname
    curafk = 0
    echo "You are now set to: ONLINE"
    ]
    ]
    ]
    alias notafk [
    if (= $afktime 0) [afkcheck]
    afktime = 0
    if (= $curafk 1) [afk 0]
    ]
    alias afkcheck [
    afktime = (+ $afktime 5)
    if (= 2 (+ (> $afktime (* $timeuntilafk 1000)) (= $curafk 0))) [afk 1]
    sleep 5 afkcheck
    ]
    bind w [forward;notafk]
    bind a [left;notafk]
    bind s [backward;notafk]
    bind d [right;notafk]
    //END of AFK Script

      La data/ora di oggi è Dom 28 Apr 2024, 08:26