PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: ??????Hawk?????? on 07 May, 2005, 02:01:29

Title: Description Tag LUA 5
Post by: ??????Hawk?????? on 07 May, 2005, 02:01:29
heya peeps  ...  


A re write of an old script  with added bonus ( see commands )





-- Another try ;-)
---Lua 5 Description Tag by ??????Hawk?????? 07-05-2005
--Commands
--
-- !dset [Nick] [Description] Sets the Description ov a Given User
-- !ddel [Nick] Sets description back to Normal. Requires user to log back in to clear.
--


HubOwner = "Your-Nick-Here" --// Set Your Nick Here
Mins =  1 --// Time in mins to update the Tags

tTables = {
tProfiles = {
["0"]  = {
["Enable"] = 1, --//  1 to enable tag    0 to disable
["Description"] = "{Master}", --// Set the Master Tag Here Eg.   ["Description"] = "I AM A MASTER",
},
["1"] = {
["Enable"] = 1,
["Description"] = "{Op}", --// Set the Operator Tag Here
},
["2"] = {
["Enable"] = 1,
["Description"] = "{Vip}", --// Set the VIP Tag Here
},
["3"] = {
["Enable"] = 1,
["Description"] = "{Reg}", --// Set the Reg Tag Here
},
["4"] = {
["Enable"] = 0,
["Description"] = "{Net Founder}", --// Set the NetFounder Tag Here
},
["5"] = {
["Enable"] = 0,
["Description"] = "{Moderator}", --// Set the Moderator Tag Here
},
},
tUserCommands = {
["!dset"] = function(user,data)
local _,_,dUser,dDescrip = string.find( data, "%b<>%s+%S+%s+(%S+)%s+(.*)" )
if dUser and dDescrip then
tTables.tUsers[dUser] = dDescrip
user:SendData(tBot,dUser.."'s Description is now set to '"..dDescrip..".")
else
user:SendData(tBot,"ERR..  Command is.... !dset [Nick] [Description]")
end
return 1
end,


["!ddel"] = function(user,data)
local _,_,dUser = string.find( data, "%b<>%s+%S+%s+(%S+).*" )
if dUser then
tTables.tUsers[dUser] = nil
user:SendData(tBot,dUser.."'s Description is now set to Normal.")
else
user:SendData(tBot,"ERR..  Command is....  !ddel [Nick]")
end
return 1
end,
},
tUsers = {},

}

tBot = frmHub:GetHubBotName()
timer = 60000 * Mins
function Main()
SetTimer(timer)
StartTimer()
end

function OnTimer()
for tProfile,tInfo in tTables.tProfiles do
if tTables.tProfiles[tProfile]["Enable"] == 1 then
for x,usr in frmHub:GetOnlineUsers(tProfile) do
local userToShow = GetItemByName(usr["sName"])
local s,e,name,desc,speed,email,share = string.find(userToShow.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)")
if tTables.tUsers[userToShow.sName] then
SendToAll( "$MyINFO $ALL "..name.." "..tTables.tUsers[userToShow.sName].."$ $"..speed.."$"..email.."$"..share.."$")
else
SendToAll( "$MyINFO $ALL "..name.." "..tTables.tProfiles[tProfile]["Description"].." "..desc.."$ $"..speed.."$"..email.."$"..share.."$")
end
end
end
end
end

function ChatArrival(curUser, data)
data = string.sub(data,1,string.len(data)-1)
local _,_,tCmd = string.find( data, "%b<>%s+(%S+).*" )
if tCmd  and curUser.sName == HubOwner then
if tTables.tUserCommands[tCmd] then
return tTables.tUserCommands[tCmd](curUser, data)
end
end

end





Have Fun Peeps


??????Hawk??????
Title:
Post by: vadertje on 07 May, 2005, 09:13:57
it works great but there is some thing not good i have by all users the same discription but i have take for every profile difrent 1 and now every 1 have the vip discription :(
Title:
Post by: ??????Hawk?????? on 07 May, 2005, 12:48:24
QuoteOriginally posted by vadertje
it works great but there is some thing not good i have by all users the same discription but i have take for every profile difrent 1 and now every 1 have the vip discription :(

Please explain more.. i dont understand the problem ...  

all seems to work fine this end  


??????Hawk??????
Title:
Post by: GeceBekcisi on 07 May, 2005, 19:09:25
I tried to add unregged users as this but it didint work (I remember profile number of unregs is -1, am i wrong?)

["-1"] = {
["Enable"] = 1,
["Description"] = "{User}", --// Set the User Tag Here
},
Title:
Post by: 6Marilyn6Manson6 on 07 May, 2005, 22:29:18
QuoteOriginally posted by GeceBekcisi
I tried to add unregged users as this but it didint work (I remember profile number of unregs is -1, am i wrong?)

["-1"] = {
["Enable"] = 1,
["Description"] = "{User}", --// Set the User Tag Here
},

You can add only profile of registered user.. User with profile -1 not is user registered and... not work ;)