PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Janhouse on 24 April, 2004, 13:35:44

Title: Fake name ( !fn )
Post by: Janhouse on 24 April, 2004, 13:35:44
I have seen script with who you can change your name.
If you type !fn  then in main chat wont show your real name but that name you wrote.
Can somebody give me that script?

Thanx...  ;)
Title:
Post by: plop on 24 April, 2004, 13:47:23
QuoteOriginally posted by Janhouse
I have seen script with who you can change your name.
If you type !fn  then in main chat wont show your real name but that name you wrote.
Can somebody give me that script?

Thanx...  ;)
crazy bot can speak like that but only has the option 2 pick between 2 preset nicks.

plop
Title:
Post by: nErBoS on 24 April, 2004, 15:27:27
Hi,

Hope it helps...

--Requested by Janhouse
--Made by nErBoS

sBot = "Fake-Talker"

function Main()
frmHub:RegBot(sBot)
end

function DataArrival(user, data)
if(strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (cmd == "!fn") then
local s,e,fnick,talk = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(.*)")
if (fnick == nil or talk == "") then
user:SendPM(sBot, "Syntax Error, !fn , you must write a nick and a message.")
else
SendToAll(sBot, talk)
end
return 1
end
end
end

Best regards, nErBoS
Title:
Post by: nErBoS on 24 April, 2004, 17:50:13
Hi,

Little bug corrected, thanks to plop.

Best regards, nErBoS
Title:
Post by: Janhouse on 24 April, 2004, 18:15:32
Thanks again nerbos!
Title:
Post by: plop on 24 April, 2004, 20:08:43
QuoteOriginally posted by nErBoS
Hi,

Little bug corrected, thanks to plop.

Best regards, nErBoS
yw.

plop
Title:
Post by: Janhouse on 25 April, 2004, 09:28:30
There is one problem.
When I type !fn Message
if don't shows that but it shows bot name.

When I write:
Quote!fn Hi, what's up?
it shows:
Hi, what's up?

What is wrong in that script?  ?(
Title:
Post by: plop on 25 April, 2004, 13:54:26
was 1 more tiny error.
--Requested by Janhouse
--Made by nErBoS

sBot = "Fake-Talker"

function Main()
   frmHub:RegBot(sBot)
end

function DataArrival(user, data)
   if(strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
      data = strsub(data,1,strlen(data)-1)
      s,e,cmd = strfind(data, "%b<>%s+(%S+)")
      if (cmd == "!fn") then
         local s,e,fnick,talk = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(.*)")
         if (fnick == nil or talk == "") then
            user:SendPM(sBot, "Syntax Error, !fn , you must write a nick and a message.")
         else
            SendToAll(fnick, talk)
         end
         return 1
      end
   end
end
remember that has to be replaced for a nick, don't write the < > when you trigger the command.
< > -- a must give option
[ ] -- a option which doesn't have to be given to make it work.

plop
Title:
Post by: nErBoS on 25 April, 2004, 17:17:50
Hi,

Baa was realy bad yesterday, thanks plop.

Best regards, nErBoS
Title:
Post by: pHaTTy on 25 April, 2004, 17:38:41
hmm look in finsihed scripts and u'll see NickChanger =)