PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: raz on 22 October, 2003, 17:53:17

Title: can u make a welcoming msg
Post by: raz on 22 October, 2003, 17:53:17
hi, can some1 make me a welcome msg for ops and users when they enter the hub. thanks
Title:
Post by: pHaTTy on 22 October, 2003, 18:02:25
sure easy ;)


Bot = "Keiko"

function NewUserConnected(user)
SendToAll(Bot,"Welcome our new user "..user.sName..", good to have you")
end

function OpConnected(user)
SendToAll(Bot,"Our Op "..user.sName..", has entered the hub")
end


thers a simple one ;)

-phatty
Title:
Post by: raz on 22 October, 2003, 18:29:46
thanks. but i need 1 which gives it in pm not on main.
Title:
Post by: pHaTTy on 22 October, 2003, 18:46:38

Bot = "Keiko"

function NewUserConnected(user)
user:SendPM(Bot,"Welcome  "..user.sName..", good to have you")
end

function OpConnected(user)
user:SendPM(Bot,"Hey "..user.sName..", welcome back at the hub")
end


-phatty
Title:
Post by: Tuben on 22 October, 2003, 20:55:07
Try this not tested ..

Make a txt .. whit the name, "msg.txt".





sBot = "-Msg-"

Message = "msg.txt"



function OpConnected(curUser)
Msg(curUser)
end
function NewUserConnected(curUser)
Msg(curUser)
end


function Msg(curUser)
readfrom(Message)
local message = ""
while 1 do
local line = read()
if (line == nil) then  break  else
message = message..line.."\r\n"
end
end
curUser:SendPM(sBot,message)
end


Title:
Post by: raz on 22 October, 2003, 21:10:01
phatty ur script doesn't work in pm and neither does ur tuban.
Title:
Post by: pHaTTy on 22 October, 2003, 21:14:48


Bot = "Keiko"

function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user)
user:SendPM(Bot,"Welcome  "..user.sName..", good to have you")
end

function OpConnected(user)
user:SendPM(Bot,"Hey "..user.sName..", welcome back at the hub")
end


that will work for sure
Title:
Post by: servaks on 22 October, 2003, 21:14:53

--Litle edit by Shhipis

botname = "Keiko"

function Main()
frmHub:RegBot(botname)
end

function NewUserConnected(user)
user:SendPM(botname,"Welcome  "..user.sName..", good to have you")
end

function OpConnected(user)
user:SendPM(botname,"Hey "..user.sName..", welcome back at the hub")
end


Title:
Post by: pHaTTy on 22 October, 2003, 21:16:00
hahaha to late :P
Title:
Post by: servaks on 22 October, 2003, 21:16:09
Damn..
Im too sow  :rolleyes:
Title:
Post by: pHaTTy on 22 October, 2003, 21:17:40
and why change to botname bot is smaller text, the less text the better, less k, so when you write a full script it has less k in size with all the text shotened down ;)
Title:
Post by: servaks on 22 October, 2003, 21:24:19
Yep...
Your right...
Btw..
The bot you help me out with..
It allready ahve a version 1.6.1  8) lol
I named it "Hub-Seciurity Bot"

/shipis
Title:
Post by: pHaTTy on 22 October, 2003, 21:30:08
hmmm yep i wud think you have added purs name in there too, as he was first to help out if i remember correctly ;)
Title:
Post by: Tuben on 22 October, 2003, 22:00:35
I think my works perfect not my fault ;))))))))))))
Title:
Post by: raz on 22 October, 2003, 22:15:38
tuben ur 1 never sent a welcoming msg at start in pm he showed it on main. thanks phatty ur second 1 works just wat i needed. thanks
Title:
Post by: pHaTTy on 22 October, 2003, 22:23:53
np m8, a pleasure :o)