• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Request] AFK tag...

ArneGoesWild

LazerPewPew
Joined
Nov 23, 2008
Messages
7
Reaction score
0
Hello
Have you also felt that it's a bit stupid and pointless some time when you were talking to player that you thought were listening when the guy actually werent infront of the comp, but now you could skip those awkward moments by letting people know that you are AFK...
...If someone would be kind enough to make this for me since I havent been able to do so myself.

Well I would want the function to be like this...

... when you say "/afk" your name will change to like "<AFK>Name"
or anything similar and when you say "/afk" while you already have the tag "<afk>" or if you move it will change your name back to its original again. But since Im now sure there is no function for changing name I'd want the function so instead of getting the name "<AFK>name" you get in a sleeping condition (Like CONST_ME_SLEEP) that will repeat it self until you once again said "/afk" or if you move.

I played Tibia for quite many years but changed to WoW for some months, but I quit and came back to Tibia (Well mostly OTs). This could explain this request. xD
 
Last edited:
Marcinek, I've got an idea. When you write /afk, the "Zzz" effect is launched on you, BUT when you log out or your position changes (when you move somewhere), the effect breaks.

Sleeping effect:
Code:
CONST_ME_SLEEP = 32
 
Marcinek said:
You cant update players name in-game yet.
There is no funciton like 'setCreatureName(cid)'.

Thought so ;<

Hermes said:
Marcinek, I've got an idea. When you write /afk, the "Zzz" effect is launched on you, BUT when you log out or your position changes (when you move somewhere), the effect breaks.

Sleeping effect:
Code:
CONST_ME_SLEEP = 32

Great idea, never thought of that ;D Thanks for the help ^^ I'll try to make this right now :)
________________________________________
But in case I fail, you could still try to make this for me ;D
 
Last edited:
I guess it is not possible to make an onMove event, the one needed to remove the 'zzz' effect.

The way it could be done is to set the ground actionid to something and make an onStepOut event that will remove actionid and 'zzz' effect.
 
I guess it is not possible to make an onMove event, the one needed to remove the 'zzz' effect.

The way it could be done is to set the ground actionid to something and make an onStepOut event that will remove actionid and 'zzz' effect.

Can't you make that every tile itemid work so that it will have a similar function as depot tiles? Like on every "onStepIn" it will remove your sleeping condition.

(With this I mean multiple tiles and not just a single tile where u have to change the actionid cuz that takes very long time if you wanna cover a whole landscape)
 
It would set it automaticaly.

Code:
local pos = getCreaturePosition(cid)
pos.stackpos = 0

if getThingfromPos(pos).uid > 0 then
    doSetItemActionId(getThingfromPos(pos).uid, 12324)
end

Im thinking now how it would stop the event, since its not global...
 
Whether it is sparkles or those "Zzz" doesn't matter, both are kinda nice ;p
But I can't seem to get the effect in a loop, only one "blink" then it doesn't show anymore ;S
 
just add it in source where it checks to kick them when 15 minutes is up, or whatever you have in config. like add the sleeping effect when 5 mins have passed.

if(idleTime > (5 * 60000) + 60000)
g_game.addMagicEffect(getPosition(), NM_ME_SLEEP);

would work, just find the spot to put it
 
Last edited:
Eh, but I think it is possible to do this in LUA. In LUA there is thingy like 'break'. But how to use this, I don't know. If player writes /afk, the Zzz appears. The position of player is stored in storage. But when player moves, event breaks.
 
The afk command would be easy to do, there would be 2 ways how to do it within lua for now,

1st. make an onThink means... When the player activates the command (example /afk) then he'll get a special storagevalue and the onThink basicly just checks if you have the storagevalue and then starts to send the animation on you.

2nd. You just make an normal talkaction and do it within addEvent
and then it sends the animations...

I'll work on both in a few and post them here then :)

kind regards, Evil Hero
 
both of those ways are alot more than needed, plus it would be abused, people would just run around with it saying there afk. However if you add it where they don't control it, then it would work, the only way todo that, without usually alot of memory would be to add it in source.
 
both of those ways are alot more than needed, plus it would be abused, people would just run around with it saying there afk. However if you add it where they don't control it, then it would work, the only way todo that, without usually alot of memory would be to add it in source.

Ofc they'll take memory since onThink will always do that but that's the only possible way without changing anything in sources.
About the People walking around with the zZzzz effect, that wont work with the way I'm going to do it, atleast not for the onThink..

kind regards, Evil Hero
 
This is not tested...

Code:
function onThink(cid)
local xpos = getPlayerStorageValue(cid,2000)
local ypos = getPlayerStorageValue(cid,2001)
local zpos = getPlayerStorageValue(cid,2002)
local SLEEP = 2003
local POSITION_DECLARED = 2004
	if getPlayerStorageValue(cid,SLEEP) == TRUE then
		if getPlayerStorageValue(cid,POSITION_DECLARED) == TRUE then
			if getCreaturePosition(cid) ~= {x=xpos,y=ypos,z=zpos} then
				setPlayerStorageValue(cid,SLEEP,-1)
				setPlayerStorageValue(cid,POSITION_DECLARED,-1)
			else
				doSendMagicEffect(cid,CONST_ME_SLEEP)
			end
		else
			setPlayerStorageValue(cid,2000,getCreaturePosition(cid).x)
			setPlayerStorageValue(cid,2001,getCreaturePosition(cid).y)
			setPlayerStorageValue(cid,2002,getCreaturePosition(cid).z)
			setPlayerStorageValue(cid,POSITION_DECLARED,1)
		end
	else
		return FALSE
	end
	return TRUE
end

Code:
function onSay(cid, words, param)
local SLEEP = 2003
local POSITION_DECLARED = 2004
	if getPlayerStorageValue(cid,SLEEP) ~= TRUE then
		setPlayerStorageValue(cid,SLEEP,1)
	else
		setPlayerStorageValue(cid,SLEEP,-1)
		setPlayerStorageValue(cid,POSITION_DECLARED,-1)
	end
	return FALSE
end

Since i didn't tested it i can't tell if it works for sure...

kind regards, Evil Hero
 
This is not tested...

Code:
function onThink(cid)
local xpos = getPlayerStorageValue(cid,2000)
local ypos = getPlayerStorageValue(cid,2001)
local zpos = getPlayerStorageValue(cid,2002)
local SLEEP = 2003
local POSITION_DECLARED = 2004
	if getPlayerStorageValue(cid,SLEEP) == TRUE then
		if getPlayerStorageValue(cid,POSITION_DECLARED) == TRUE then
			if getCreaturePosition(cid) ~= {x=xpos,y=ypos,z=zpos} then
				setPlayerStorageValue(cid,SLEEP,-1)
				setPlayerStorageValue(cid,POSITION_DECLARED,-1)
			else
				doSendMagicEffect(cid,CONST_ME_SLEEP)
			end
		else
			setPlayerStorageValue(cid,2000,getCreaturePosition(cid).x)
			setPlayerStorageValue(cid,2001,getCreaturePosition(cid).y)
			setPlayerStorageValue(cid,2002,getCreaturePosition(cid).z)
			setPlayerStorageValue(cid,POSITION_DECLARED,1)
		end
	else
		return FALSE
	end
	return TRUE
end

Code:
function onSay(cid, words, param)
local SLEEP = 2003
local POSITION_DECLARED = 2004
	if getPlayerStorageValue(cid,SLEEP) ~= TRUE then
		setPlayerStorageValue(cid,SLEEP,1)
	else
		setPlayerStorageValue(cid,SLEEP,-1)
		setPlayerStorageValue(cid,POSITION_DECLARED,-1)
	end
	return FALSE
end

Since i didn't tested it i can't tell if it works for sure...

kind regards, Evil Hero


Neither one is unfortunately working ;(
 
Tell me how you added them, or atleast what error you get.
and btw those Scripts belong together...

The first is to check if the player has the afk status and if he's moving...
The Second is just to set your status afk...

kind regards, Evil Hero
 
Back
Top