• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction deleted thread

Great script :)
but...
can you make a new channel who names "World news", and all news send here?
That will be great :3
 
Nice releasing a lot lately ! keep it up.
 
Great script :)
but...
can you make a new channel who names "World news", and all news send here?
That will be great :3

I was working on something different, but I found this function - this way you can send world news directly to channel without checking players - just anyone who want to see it opens this channel, that's all:
sendChannelMessage(CHANNEL_ID, TALKTYPE, text)

Check for errors, I'm too lazy to maintain 0.3.7 database atm
XML:
		<globalevent name = "popquiz" interval = "20" event = "script"><![CDATA[
			domodlib("news")
			function onThink(interval)
				local playersWatching, averageLevel, averageMoney, playersOnline = 0, 0, 0, 0
				for i = 1, 3 do -- not sure what it actually does so I'll keep it
					for _, pid in pairs(getPlayersOnline()) do
						if(i == 1) then
							averageLevel, averageMoney, playersOnline = averageLevel + getPlayerLevel(pid), averageMoney + getPlayerMoney(pid), playersOnline + 1
						end
					end
				end
					playersWatching = table.maxn(getChannelUsers(CHANNEL_ID))
					sendChannelMessage(CHANNEL_ID, MESSAGE_STATUS_CONSOLE_ORANGE, os.date("%H:%M:%S", os.time()) .. " [WORLD NEWS]: Currently there are " .. playersOnline .. " player(s) online.")
					sendChannelMessage(CHANNEL_ID, MESSAGE_STATUS_CONSOLE_ORANGE, os.date("%H:%M:%S", os.time()) .. " [WORLD NEWS]: " .. playersWatching .. " are currently watching world news.")
					sendChannelMessage(CHANNEL_ID, MESSAGE_STATUS_CONSOLE_ORANGE, os.date("%H:%M:%S", os.time()) .. " [WORLD NEWS]: The average level in this moment is " .. averageLevel / playersOnline .. " and average money kept is " .. averageMoney / playersOnline .. ".")
				return true
			end
		]]></globalevent>
 
Last edited:
Back
Top