PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Finished Scripts => Topic started by: [NL]Daddy-Bear? on 08 March, 2008, 16:07:37

Title: Crew online v 1.1_lua 5.1.3
Post by: [NL]Daddy-Bear? on 08 March, 2008, 16:07:37
Hello it?s me again.

Converted to new Api,
Crew online v 1.1_lua 5.1.3 by [NL]Daddy-Bear?

Respectfully,

[NL]Daddy-Bear?
Title: Re: Crew online v 1.1_lua 5.1.3
Post by: [NL]Daddy-Bear? on 15 March, 2008, 00:17:50
Hello it?s me again.

Thanks Offski to bring to my attention a little bug.
Lua above has been a update.

Respectfully,

[NL]Daddy-Bear?
Title: Re: Crew online v 1.1_lua 5.1.3
Post by: eagle00789 on 20 March, 2008, 15:22:44
i have updated this script, so that you can choose if you want to register the bot on your hub or not. If the bot is not registered, the botname will still be used when the message is posted.

--[[
*********************  Name: Crew online-lua  v 1.2   for lua 5.1 *********************
********************** Made by [NL]Daddy-Bear? May 2007  *********************** 

This is what the lua does:
On a settable interval it gifs info to all Users over the Crew witch is online, and there profile.
If no Crew online it will tell also the Users.
Time repeat of the info you can set it  >>>  interval = 30 means every 30 min.
See line under the quote Start of User Settings in this lua.

March 2008: Rewrote for the new Api by [NL]Daddy-Bear?
15-03-08 :  Crew online v 1.2_5.1.3
Thanks Offski to bring to my attention a little bug.
Lua has a been update.
20 March 2008: Added the possibility to register the bot or not by Eagle00789

???????????? Lets enjoy our Hobby ??????????
]]
-- -------------------------------------------  Start of User Settings  -------------------------------------------
interval = 60 -- Interval [in minutes] before trigger
rBot = 0 -- Register the bot in the hub? (1=yes 2=no)
sBot = "-+=The_Crew=+-"     -- Name of the bot
-- -------------------------------------------  End of User Settings  ---------------------------------------------

-- -------------------------------------------- don't chance below !! ---------------------------------------------
Sec  = 1000
Min  = 60*Sec
Hour = 60*Min
Day  = 24*Hour
bov = ("\r\n\r\n\t\t\t\t\t    Online Master/Moderator informatie\r\n\r\n\t\t=======================  Geen idee of ze in de buurt van de pc zijn  =====================\r\n")
gooi = 1
function OnStartup()
if rBot == 1 then
Core.RegBot(sBot,"","",true)
end
tmr = TmrMan.AddTimer(Min*interval)
end

local Profiles  = {
[-1] = false, --Unregistered User
[0] = true, --Master
[1] = true, --Operator
[2] = false, --Vip
[3] = false, --Registered User
}

function OnTimer(tmr)
ond = ("\r\n\r\n\t\t========================== Info gegeven op "..os.date("%I:%M:%S - %p").." ===========================\r\n")
txtn = "" txto = "" txtma = "" txtmo = "" txtop = "" msg = "" msgsend = ""
gooi = 0
for i,v in pairs(Core.GetOnlineUsers(true)) do
local online = ""
local nick = ""
nick = v["sNick"]
sUser = Core.GetUser(nick,true)
if sUser.iProfile == 0 then
gooi = 2
txtma1 = ("\r\n\t\t\t\tMaster online for U\t\t"..nick.."")
txtma = (""..txtma1.."")
msg = (""..msg..""..txtma.."")
end
if sUser.iProfile == 1 then
gooi = 2
txtop1 = ("\r\n\t\t\t\tOperator online for U\t\t"..nick.."")
txtop = (""..txtop1.."")
msg = (""..msg..""..txtop.."")
end
end
if gooi == 2 then
if rBot == 1 then
msgsend = (""..bov..""..msg..""..ond.."")
else
msgsend = ("<"..sBot..">"..bov..""..msg..""..ond.."")
end
Core.SendToAll (msgsend)
end
if gooi == 0 then
if rBot == 1 then
msg = ("\r\n\t\t\t\t\tNo Crew Online at this moment    :(\r\n\r\n\t\t\t\tDon?t think now I can play, my checker is watching U  :-))")
else
msg = ("<"..sBot..">\r\n\t\t\t\t\tNo Crew Online at this moment    :(\r\n\r\n\t\t\t\tDon?t think now I can play, my checker is watching U  :-))")
end
Core.SendToAll (msg)
end
collectgarbage(collect)
end
Title: Re: Crew online v 1.1_lua 5.1.3
Post by: [NL]Daddy-Bear? on 20 March, 2008, 23:28:58
Hello it?s me again.

Okay it can also this way eagle00789 well done keep it up nice work.  ;D
But please what you put on the forum using then the standard off PoKax 0.4.0.0 meaning:
local Profiles  = {
[-1] = false, --Unregistered User
[0] = true, --Master
[1] = true, --Operator
[2] = false, --Vip
[3] = false, --Registered User
}

And please let the credits for what they are.
For example i am missing
15-03-08 :  Crew online v 1.2_5.1.3
Thanks Offski to bring to my attention a little bug.
Lua has a been update.


Respectfully,

[NL]Daddy-Bear?
Title: Re: Crew online v 1.1_lua 5.1.3
Post by: eagle00789 on 23 March, 2008, 22:08:32
sorry for the removal of that changelog bit mate. wasn't intentional to do that. i just put them back in :D
also, i just fixed the above script to only include the default profiles :D
Title: Re: Crew online v 1.1_lua 5.1.3
Post by: [NL]Daddy-Bear? on 23 March, 2008, 22:52:23
thanks,

eagle00789  ;D
Title: Re: Crew online v 1.1_lua 5.1.3
Post by: eagle00789 on 23 March, 2008, 23:03:21
no problem NL]Daddy-Bear?. i hate it myself to when someone removes your credits, so i must have overlooked that bit.....
Title: Re: Crew online v 1.1_lua 5.1.3
Post by: [NL]Daddy-Bear? on 20 September, 2008, 16:22:53
Hello it?s me again.

Px conflict with the lua solved if there is no crew online
Add. Possibility to send an vote address with the info (You can put it on or off).
Add. Something for the view in main

Lua above has been  updated.

Respectfully,

[NL]Daddy-Bear?