• 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!

Auto execute talkaction on server start

Kiman

Reality OT Staff
Joined
Aug 18, 2009
Messages
530
Reaction score
7
Location
Sweden
I want to execute one of my talkactions on serverstart. The talkaction is !tps, it creates texts over tps and tiles etc.
Everytime the server crashes, I have to log in and write !tps to activate it and it's really annoying.

I use TFS 0.2.5, my server does not have Globalevents.

Please help me
Rep+ for you
 
Last edited:
I want to execute one of my talkactions on serverstart. The talkaction is !tps, it creates texts over tps and tiles etc.
Everytime the server crashes, I have to log in and write !tps to activate it and it's really annoying.

I use TFS 0.2.5, my server does not have Globalevents.

Please help me
Rep+ for you
You can add it in 'onLogin' in creaturescripts like (it run when first player login:
PHP:
function onLogin(cid)
   ...
   if(initialized == 0) the
      initialized == 1
      -- add create texts events functions
   end
   ... -- rest of onlogin orginal script
end
and in global.lua add:
PHP:
initailized = 0
but dont reload creaturescripts :>
---------
you can add animations and text (execute 1 or 2 time/sec [check your server]) in npc onThink(cid) function
 
Last edited:
Could you show me an example of how to do it ?, Doesn't work. Here's my script i use right now

Code:
 ---- Made by himad
local timespeed = 2000 -- 2000 = 2 seconds
local function loop()
doSendAnimatedText({x=776,y=693,z=7}, 'Training', math.random(01,255))
doSendAnimatedText({x=778,y=693,z=7}, 'City', math.random(01,255))
doSendAnimatedText({x=780,y=693,z=7}, 'Teleports', math.random(01,255))
doSendAnimatedText({x=782,y=693,z=7}, 'Beginners', math.random(01,255))
doSendAnimatedText({x=773,y=693,z=7}, 'Blessings', math.random(01,255))
doSendAnimatedText({x=774,y=693,z=7}, 'Blessings', math.random(01,255))
doSendAnimatedText({x=784,y=693,z=7}, 'VIP Area', math.random(01,255))
doSendAnimatedText({x=785,y=693,z=7}, 'VIP Area', math.random(01,255))
doSendAnimatedText({x=777,y=702,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=778,y=702,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=780,y=702,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=781,y=702,z=7}, 'War Zone', math.random(01,255))
--- Aqui poe as funçoes que ocorreram de 3 em 3 segundos.
addEvent(loop, timespeed, valore) -- N?o remova isso
end

--- isso abaixo e para iniciar o loop.
function onSay(cid, words, param)
valore = {cid = cid, topos = topos}
addEvent(loop, velocidade, valore)
end
 
I'll post code in 2-3 days how to use 'creaturescripts' as 'globalevents' codes in 0.2.5. Just w8 2 days or post your code.
 
He's just dreaming :D
Lua:
local started = false
function onLogin(cid)
    if(started == false) then
        started = true

        --code that is in talkaction script, paste it here!
    end
    return TRUE
end
 
Last edited:
Code:
function onLogin(cid)
    if(started == false) then
        started = true

       local timespeed = 2000 -- 2000 = 2 seconds
local function loop()
doSendAnimatedText({x=776,y=693,z=7}, 'Training', math.random(01,255))
doSendAnimatedText({x=778,y=693,z=7}, 'City', math.random(01,255))
doSendAnimatedText({x=780,y=693,z=7}, 'Teleports', math.random(01,255))
doSendAnimatedText({x=782,y=693,z=7}, 'Beginners', math.random(01,255))
doSendAnimatedText({x=773,y=693,z=7}, 'Blessings', math.random(01,255))
doSendAnimatedText({x=774,y=693,z=7}, 'Blessings', math.random(01,255))
doSendAnimatedText({x=784,y=693,z=7}, 'VIP Area', math.random(01,255))
doSendAnimatedText({x=785,y=693,z=7}, 'VIP Area', math.random(01,255))
doSendAnimatedText({x=777,y=702,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=778,y=702,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=780,y=702,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=781,y=702,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=841,y=696,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=841,y=697,z=7}, 'War Zone', math.random(01,255))
doSendAnimatedText({x=779,y=698,z=7}, 'Shops', math.random(01,255))
--- Aqui poe as funçoes que ocorreram de 3 em 3 segundos.
addEvent(loop, timespeed, valore) -- N?o remova isso
end

--- isso abaixo e para iniciar o loop.
function onSay(cid, words, param)
valore = {cid = cid, topos = topos}
addEvent(loop, velocidade, valore)
end
    end
    return TRUE
end

Doesn't work, can you figure out what I'm doing wrong ?
I also want the script to just execute one time, when the first player logs in. Not that it reloads when other players login, then the text over the tiles will freak out and it will create 1000 messages

Thanks
 
Try this one..
Lua:
function onLogin(cid)
	if(started == false) then
		started = true
	end

	local timespeed = 2000 -- 2000 = 2 seconds
	local function loop()
		doSendAnimatedText({x=776,y=693,z=7}, 'Training', math.random(01,255))
		doSendAnimatedText({x=778,y=693,z=7}, 'City', math.random(01,255))
		doSendAnimatedText({x=780,y=693,z=7}, 'Teleports', math.random(01,255))
		doSendAnimatedText({x=782,y=693,z=7}, 'Beginners', math.random(01,255))
		doSendAnimatedText({x=773,y=693,z=7}, 'Blessings', math.random(01,255))
		doSendAnimatedText({x=774,y=693,z=7}, 'Blessings', math.random(01,255))
		doSendAnimatedText({x=784,y=693,z=7}, 'VIP Area', math.random(01,255))
		doSendAnimatedText({x=785,y=693,z=7}, 'VIP Area', math.random(01,255))
		doSendAnimatedText({x=777,y=702,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=778,y=702,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=780,y=702,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=781,y=702,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=841,y=696,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=841,y=697,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=779,y=698,z=7}, 'Shops', math.random(01,255))
		--- Aqui poe as funçoes que ocorreram de 3 em 3 segundos.
		addEvent(loop, timespeed, valore) -- N?o remova isso
	end

	--- isso abaixo e para iniciar o loop.
	addEvent(loop, timespeed)
	return TRUE
end
 
Try this one..
Lua:
function onLogin(cid)
	if(started == false) then
		started = true
	end

	local timespeed = 2000 -- 2000 = 2 seconds
	local function loop()
		doSendAnimatedText({x=776,y=693,z=7}, 'Training', math.random(01,255))
		doSendAnimatedText({x=778,y=693,z=7}, 'City', math.random(01,255))
		doSendAnimatedText({x=780,y=693,z=7}, 'Teleports', math.random(01,255))
		doSendAnimatedText({x=782,y=693,z=7}, 'Beginners', math.random(01,255))
		doSendAnimatedText({x=773,y=693,z=7}, 'Blessings', math.random(01,255))
		doSendAnimatedText({x=774,y=693,z=7}, 'Blessings', math.random(01,255))
		doSendAnimatedText({x=784,y=693,z=7}, 'VIP Area', math.random(01,255))
		doSendAnimatedText({x=785,y=693,z=7}, 'VIP Area', math.random(01,255))
		doSendAnimatedText({x=777,y=702,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=778,y=702,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=780,y=702,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=781,y=702,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=841,y=696,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=841,y=697,z=7}, 'War Zone', math.random(01,255))
		doSendAnimatedText({x=779,y=698,z=7}, 'Shops', math.random(01,255))
		--- Aqui poe as funçoes que ocorreram de 3 em 3 segundos.
		addEvent(loop, timespeed, valore) -- N?o remova isso
	end

	--- isso abaixo e para iniciar o loop.
	addEvent(loop, timespeed)
	return TRUE
end

Still doesn't execute when i log in <_<
 
Code:
function onLogin(cid)

local started = false
        if(started == false) then
                started = true
				 local timespeed = 2000 -- 2000 = 2 seconds
                 local function loop()
                doSendAnimatedText({x=776,y=693,z=7}, 'Training', math.random(01,255))
                doSendAnimatedText({x=778,y=693,z=7}, 'City', math.random(01,255))
                doSendAnimatedText({x=780,y=693,z=7}, 'Teleports', math.random(01,255))
                doSendAnimatedText({x=782,y=693,z=7}, 'Beginners', math.random(01,255))
                doSendAnimatedText({x=773,y=693,z=7}, 'Blessings', math.random(01,255))
                doSendAnimatedText({x=774,y=693,z=7}, 'Blessings', math.random(01,255))
                doSendAnimatedText({x=784,y=693,z=7}, 'VIP Area', math.random(01,255))
                doSendAnimatedText({x=785,y=693,z=7}, 'VIP Area', math.random(01,255))
                doSendAnimatedText({x=777,y=702,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=778,y=702,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=780,y=702,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=781,y=702,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=841,y=696,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=841,y=697,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=779,y=698,z=7}, 'Shops', math.random(01,255))
                --- Aqui poe as funçoes que ocorreram de 3 em 3 segundos.
                addEvent(loop, timespeed, valore) -- N?o remova isso
        end

        --- isso abaixo e para iniciar o loop.
        addEvent(loop, timespeed)
        end
		return TRUE
end

This time i tryed with your script you posted above, Still wont work. :/
 
Code:
function onLogin(cid)

local started = false
        if(started == false) then
                started = true
				 local timespeed = 2000 -- 2000 = 2 seconds
                 local function loop()
                doSendAnimatedText({x=776,y=693,z=7}, 'Training', math.random(01,255))
                doSendAnimatedText({x=778,y=693,z=7}, 'City', math.random(01,255))
                doSendAnimatedText({x=780,y=693,z=7}, 'Teleports', math.random(01,255))
                doSendAnimatedText({x=782,y=693,z=7}, 'Beginners', math.random(01,255))
                doSendAnimatedText({x=773,y=693,z=7}, 'Blessings', math.random(01,255))
                doSendAnimatedText({x=774,y=693,z=7}, 'Blessings', math.random(01,255))
                doSendAnimatedText({x=784,y=693,z=7}, 'VIP Area', math.random(01,255))
                doSendAnimatedText({x=785,y=693,z=7}, 'VIP Area', math.random(01,255))
                doSendAnimatedText({x=777,y=702,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=778,y=702,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=780,y=702,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=781,y=702,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=841,y=696,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=841,y=697,z=7}, 'War Zone', math.random(01,255))
                doSendAnimatedText({x=779,y=698,z=7}, 'Shops', math.random(01,255))
                --- Aqui poe as funçoes que ocorreram de 3 em 3 segundos.
                addEvent(loop, timespeed, valore) -- N?o remova isso
        end

        --- isso abaixo e para iniciar o loop.
        addEvent(loop, timespeed)
        end
		return TRUE
end

This time i tryed with your script you posted above, Still wont work. :/

Try this
Lua:
local config = {
	started = false,
	speedTime = 2000
}
function onEffect()
    doSendAnimatedText({x=776,y=693,z=7}, 'Training', math.random(1,255))
    doSendAnimatedText({x=778,y=693,z=7}, 'City', math.random(1,255))
    doSendAnimatedText({x=780,y=693,z=7}, 'Teleports', math.random(1,255))
    doSendAnimatedText({x=782,y=693,z=7}, 'Beginners', math.random(1,255))
    doSendAnimatedText({x=773,y=693,z=7}, 'Blessings', math.random(1,255))
    doSendAnimatedText({x=774,y=693,z=7}, 'Blessings', math.random(1,255))
    doSendAnimatedText({x=784,y=693,z=7}, 'VIP Area', math.random(1,255))
    doSendAnimatedText({x=785,y=693,z=7}, 'VIP Area', math.random(1,255))
    doSendAnimatedText({x=777,y=702,z=7}, 'War Zone', math.random(1,255))
    doSendAnimatedText({x=778,y=702,z=7}, 'War Zone', math.random(1,255))
    doSendAnimatedText({x=780,y=702,z=7}, 'War Zone', math.random(1,255))
    doSendAnimatedText({x=781,y=702,z=7}, 'War Zone', math.random(1,255))
    doSendAnimatedText({x=841,y=696,z=7}, 'War Zone', math.random(1,255))
    doSendAnimatedText({x=841,y=697,z=7}, 'War Zone', math.random(1,255))
    doSendAnimatedText({x=779,y=698,z=7}, 'Shops', math.random(1,255))

	return TRUE
end

function onLogin(cid)
    if(config.started == false) then
        config.started = true
		addEvent(onEffect, config.speedTime)
	end
	return TRUE
end
 
Back
Top