PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: _Satan_ on 04 September, 2004, 09:33:18

Title: changing user name in userlist
Post by: _Satan_ on 04 September, 2004, 09:33:18
is there something that can override the actual nick of a particular user and show it and shows something else in userlist  and in main chat too :D just for teasing
Title:
Post by: Herodes on 04 September, 2004, 10:08:26
Yes u can but as soon as his client sents another $MyINFO then you'll need to cover that up again ..

and possibly pm will not be working probably ... and also downloads may also have some problems ...

ofcourse there is a way to resolve those issues too..
but its gonna take bandwidth for that .. quite an amount of it  ;)
Title:
Post by: _Satan_ on 04 September, 2004, 14:43:46
Since hub is on LAN bandwith is not a problem. Also ip is known . can not the nick be modified dynamically every time a message arrives. pms and downlads may use orignal nicks since it is a direct tcp connection between to clients Am i right???
Title:
Post by: Herodes on 04 September, 2004, 15:37:03
yep I understand what u mean ...

I'll be back with a script ... unless some1 else gets it first ... ;)
Title:
Post by: Herodes on 04 September, 2004, 17:51:34
Seems that I've run into problems ...
--- John The Baptist v1
--- by Herodes 4/9-2004
--- --- --- --- ---
--- Changes the nicks of users ...
--- not a functional script .. It is not letting cmds for aother scripts to go throught it ...
--- doesnt work as expected in pm ... :(
--- PS: bad day probably ...
--- --- --- --- ---
allowedprof = 0
TelltoOps = nil


tNicks = {
["Herodes"] = "sedoreH",
}

function DataArrival(user, data)
if strsub(data, 1,1) == "<" then
if tNicks[user.sName] then
s,e, msg = strfind(data, "%b<>%s+(.*)")
SendToAll("<"..tNicks[user.sName].."> "..msg)
return 1
end
elseif strsub(data, 1,4) == "$To:" then
s,e,toWho,fromWho,msg = strfind(data, "$To:%s(%S+)%sFrom:%s(%S+)%s%$%b<>%s(.*)|")
if tNicks[fromWho] then
frmHub:RegBot(tNicks[fromWho])
usr = GetItemByName(toWho)
if usr then
usr:SendPM(tNicks[fromWho], msg)
end
frmHub:UnregBot(tNicks[fromWho])
return 1
end
end
end

that one dont work as intended ... I hope to work out its problems but all in good time ..
Title:
Post by: _Satan_ on 20 September, 2004, 04:46:00
function DataArrival(user, data)
   if strsub(data, 1,1) == "<" then
      if tNicks[user.sName] then
         s,e, msg = strfind(data, "%b<>%s+(.*)")
         SendToAll("<"..tNicks[user.sName].."> "..msg)
         return 1
      end
..........................
how could msg be excuted ??
or this script executes last u can see  plops zcrazy bot then it will be simple task to run the above code.
Title:
Post by: BottledHate on 20 September, 2004, 06:13:04
by giving it a table to work with....
(this will NOT change their name in the users list.)
only change the main chat name.

tNicks = {
   ["Nick1"] = "RplaceNick1",
   ["Nick2"] = "ReplaceNick2",
   ["?ottledHat?"] = "GOD",
}

function DataArrival(user, data)
   if strsub(data, 1,1) == "<" then
      if tNicks[user.sName] then
         s,e, msg = strfind(data, "%b<>%s+(.*)")
         SendToAll("<"..tNicks[user.sName].."> "..msg)
         return 1
      end
   end
end

hope this helps...

-BH
Title:
Post by: _Satan_ on 20 September, 2004, 06:29:05
whats the change still commands  do not work
Title:
Post by: BottledHate on 20 September, 2004, 06:31:24
ok.. u lost me.

-BH
Title:
Post by: _Satan_ on 20 September, 2004, 06:40:47
thanxxx
Title:
Post by: BottledHate on 20 September, 2004, 06:41:50
what is your command prefix????

ie: !, +, # ....

plug it into the "CommandPrefix"

CommandPrefix = "!"
tNicks = {

   ["Nick1"] = "RplaceNick1",
   ["Nick2"] = "ReplaceNick2",
   ["?ottledHat?"] = "GOD",
}

function DataArrival(user, data)
   if strsub(data, 1,1) == "<" then
      if tNicks[user.sName] then
         s,e, msg = strfind(data, "%b<>%s+(.*)")
         if strsub(msg,1,1) == CommandPrefix then return end
         SendToAll("<"..tNicks[user.sName].."> "..msg)
         return 1
      end
   end
end

-BH
Title:
Post by: BottledHate on 20 September, 2004, 06:57:50
my command prefix in my hub is !... !help !banip.. whatever... som in command prefix i put "!" ... and commands worked fine.  the pm side still doesn't work right.. and i'm not sure if it ever will.



--- John The Baptist v1
--- by Herodes 4/9-2004
--- minor edit by BottledHate... still not working proper (yet)
--- --- --- --- ---
--- Changes the nicks of users ...
--- not a functional script .. It is not letting cmds for aother scripts to go throught it ...
--- doesnt work as expected in pm ... :(
--- PS: bad day probably ...
--- --- --- --- ---
allowedprof = 0
TelltoOps = nil
CommandPrefix = "!"

tNicks = {
["?ottledHat?"] = "DEMI-GOD",
}

function DataArrival(user, data)
if strsub(data, 1,1) == "<" then
if tNicks[user.sName] then
s,e, msg = strfind(data, "%b<>%s+(.*)")
         if strsub(msg,1,1) == CommandPrefix then return end
SendToAll("<"..tNicks[user.sName].."> "..msg)
return 1
end
elseif strsub(data, 1,4) == "$To:" then
s,e,toWho,fromWho,msg = strfind(data, "$To:%s(%S+)%sFrom:%s(%S+)%s%$%b<>%s(.*)|")
if tNicks[fromWho] then
usr = GetItemByName(toWho)
if usr then
            if strfind(msg,1,1) == CommandPrefix then return end
usr:SendPM(tNicks[fromWho], msg)
end
frmHub:UnregBot(tNicks[fromWho])
return 1
end
end
end


-BH
Title:
Post by: _Satan_ on 20 September, 2004, 07:00:06
thanx got this part going renamed the file as zzz.lua i think the the scripts have there priority based on their name . now it works well for jumble fever too..
Title:
Post by: BottledHate on 20 September, 2004, 07:21:25
glad i could be of some help.  :D

-BH