[SCRIPT] AFK-Script

[SCRIPT] AFK-Script

Messaggioda Andrez » 19/07/2012, 18:20

Codice: Seleziona tutto
//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
Avatar utente
Andrez
 
Messaggi: 27
Iscritto il: 14/05/2012, 12:15
Località: Sicilia

Torna a Mapping, Modding & Scripting

Chi c’è in linea

Visitano il forum: Nessuno e 1 ospite

cron