PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: DoD_Owner on 07 January, 2004, 02:24:25

Title: Special Welcome msg when login
Post by: DoD_Owner on 07 January, 2004, 02:24:25
Hey.. it's me again.. ;-)

I need a script that allows me to have a single welcome text for each user .... I have to be able to insert nick and then make the welcome text.

Plz help me out....
Title:
Post by: tezlo on 07 January, 2004, 03:58:53
there we go..
botname = "whatever"

welcome = {
-- ["nick"] = "message",
["DoD_Owner"] = "wheee!",
}

function NewUserConnected(user)
local msg = welcome[user.sName]
if msg then SendToAll(botname, msg) end
end

OpConnected = NewUserConnected
Title:
Post by: DoD_Owner on 12 January, 2004, 12:42:01
I'm probably the n00b here, but I cant make it work..

If I wanna make the bot say   "He's back and he's evil"! when the OP [DK]Bobo_2k logs on... then what ??

And what to do if I want one for each OP ? Make 1 script per user or can I combine it all ?

//Shadow
Title:
Post by: SaintSinner on 12 January, 2004, 13:49:52
Change the "nick" to the name you want
and the "message" to whatever you want the bot to say.


botname = "WelcomeBot"

welcome = {
-- ["[DK]Bobo_2k"] = "He's back and he's evil",
["DoD_Owner"] = "wheee!",
}

function NewUserConnected(user)
local msg = welcome[user.sName]
if msg then SendToAll(botname, msg) end
end

OpConnected = NewUserConnected


you can also search in the finished scripts section.
Title:
Post by: [NL]trucker on 12 January, 2004, 14:10:20
SaintSinner and Tezlo

dont get me wrong please

but i think he wants a bot where he can specify user and message for a lot of users.
And this bot is just for  1 user or...

welcome = {
   -- ["[DK]Bobo_2k"] = "He's back and he's evil",
                --"user" = "message"
                --"user" = "message"
                --"?ser" = "message"
   ["DoD_Owner"] = "wheee!",
}

wil this work for him??
so can he add as many users as he prefers this way ?

just trying to learn .
Title:
Post by: Cid on 12 January, 2004, 15:36:53
botname = "DaBotname"

welcome = {
   ["NTF"] = "Hub Owner NTF has entered.",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   [""] = "",
   ["FakeFinder"] = "FakeFinder has entered the Hub, he will find you all!",
}

function NewUserConnected(user)
   local msg = welcome[user.sName]
   if msg then SendToAll(botname, msg) end
end

OpConnected = NewUserConnected
Title:
Post by: Cid on 12 January, 2004, 16:11:17
And here is the script with userspecific Welcome and Goodbye message

botname = "DaBotname"

welcome = {
   ["NTF"] = "One of the Hub Owners, NTF, has entered the Hub. Damn! He's a hunk of a man!",
   [""] = "",
   [""] = "",
   ["FakeFinder"] = "FakeFinder has entered the Hub, he will find you all!",
}

goodbye = {
   ["NTF"] = "One of the Hub Owners, NTF, has left the Hub. He was handsome!",
   [""] = "",
   [""] = "",
   ["FakeFinder"] = "FakeFinder has left the Hub, he will come back",
}


function NewUserConnected(user)
   local msg = welcome[user.sName]
   if msg then SendToAll(botname, msg) end
end

function UserDisconnected(user)
   local msg = goodbye[user.sName]
   if msg then SendToAll(botname, msg) end
end

OpConnected = NewUserConnected
OpDisconnected = UserDisconnected
Title:
Post by: plop on 12 January, 2004, 16:21:47
yep trucker,  you can add as many as you want.

plop
Title:
Post by: DoD_Owner on 12 January, 2004, 16:38:23
Thx for the help all... now it works... great... I owe ya guys ;-)

//Shadow
Title: question
Post by: XPMAN on 13 January, 2004, 08:18:52
Question guys, how do make the bot, like in the script that Cid did not show in the users list? I like the welcome and leaving message. or does it have to appear in order for the script to work correctly? Just try to keep the bot appearance down to a min when i can.

Thnx for everything u guys do. I know a simple thank u isn't much sometimes, but its all we got. One day maybe i can learn enough to help the way you all do. Till then, i guess i will watch and learn....
Title:
Post by: DoD_Owner on 13 January, 2004, 19:37:30
If you have a bot (you probably do).. let's say it's called  "Cool-Bot", then simply in all the scripts you add, call the bot the same name... then it all will appear as the same bot...

I hope it was the answer you needed...

//Shadow
Title: didn't work :(
Post by: XPMAN on 14 January, 2004, 07:08:29
Couldn't get any of those welcome scripts to work..at all.

I run Robocop 4 and it seems to not like it at all. I went into the interface of Robocop and unchecked the welcome and goodbye for all the different profiles,restarted the hub and still didn't work.  I am a beta tester of the 330 version, maybe it is that, was really looking forward to trying these out though. When i disabled the profiles in Robocop and restarted the hub. No welcome mess was displayed at all. Even though I had the script running.  Anybody no how to fix this problem. Pretty sure its Robocop stopping it, just don't know how to get around it....
Title:
Post by: [NL]trucker on 14 January, 2004, 22:38:06
thnx cid

this bot works fine :-))


Xpman

i have a bot called [guard] this is in fact my main-script

and all external bots i have named [guard]

and they work like a charm :-)

and i work with 0.3.30 build 15.18 and i have no probs at all with this bot.
Title:
Post by: plop on 14 January, 2004, 23:23:01
QuoteOriginally posted by XPMAN
Couldn't get any of those welcome scripts to work..at all.

I run Robocop 4 and it seems to not like it at all. I went into the interface of Robocop and unchecked the welcome and goodbye for all the different profiles,restarted the hub and still didn't work.  I am a beta tester of the 330 version, maybe it is that, was really looking forward to trying these out though. When i disabled the profiles in Robocop and restarted the hub. No welcome mess was displayed at all. Even though I had the script running.  Anybody no how to fix this problem. Pretty sure its Robocop stopping it, just don't know how to get around it....
have you tryed just running this welcome bot and nothing more.??

plop
Title: disabled bots
Post by: XPMAN on 15 January, 2004, 06:48:48
I dont run alot of bots, just a few. A couple security bots..including Robocop, and your texterbot. I will try trial and error by disabling the bots one at a time and try to narrow down which one might be causing the problem.

Thanks for the idea though.