PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: (????H??v?????v?L????) on 07 July, 2004, 16:15:13

Title: Onjoin message for different profiles
Post by: (????H??v?????v?L????) on 07 July, 2004, 16:15:13
Hi,

i would like a script that can send different message's to different user profiles wen a user logs in.

thanx Heavens Devil :)

(soz if there is a script that all ready does this but i could not find it in a search)
Title:
Post by: ((UKSN))shad_dow on 07 July, 2004, 18:30:09
for radom intro/outs for diffetn profiles try:-

Random Welcome for Ops/Vips (http://board.univ-angers.fr/thread.php?threadid=1912&boardid=11&sid=cb1815be9291593405dffb0ce1b187c3)


and here:-

Random intro/outro by chaggydawg (http://217.120.180.188/Forum4/redirect.php?dlid=86&PHPSESSID=fb846b41b434e8747b6ee54b456ca402)

or give vips/op there own welcomes
:-

Intro/Outro for Specific Users (http://board.univ-angers.fr/thread.php?threadid=1602&boardid=6&sid=cb1815be9291593405dffb0ce1b187c3)

hope thses help

yours
shad
Title:
Post by: (????H??v?????v?L????) on 07 July, 2004, 20:07:19
Hi,

soz i did not explain wot i wanted the bot to do.

i would like the bot to send a pm to different profiles wen they log in,

example,

op logs in = the bot would send a message from a textfile to the op

vip logs in = the bot would send a different text file to the vip

and so on...

hope that helps  :)

thanx Heavens Devil :)
Title:
Post by: plop on 07 July, 2004, 22:17:27
QuoteOriginally posted by (????H??v?????v?L????)
Hi,

soz i did not explain wot i wanted the bot to do.

i would like the bot to send a pm to different profiles wen they log in,

example,

op logs in = the bot would send a message from a textfile to the op

vip logs in = the bot would send a different text file to the vip

and so on...

hope that helps  :)

thanx Heavens Devil :)

check out my texter 4.x.

plop
Title:
Post by: ((UKSN))shad_dow on 07 July, 2004, 22:42:33
LO Plop see u beat me to it again PMFSL

yours shad
Title:
Post by: (????H??v?????v?L????) on 07 July, 2004, 23:39:42
Hi again,

Thanx Shad and Plop for the fast answers and help :)

I have 1 prob with the script, Every time i type +help in pm to the bot it disconnect's me
Title:
Post by: Herodes on 07 July, 2004, 23:48:22
here u go man I think this is quite working for u ...

--- Profile Txt Intro  ?   requested by (????H??v?????v?L????)
--- by Herodes

--- --- ^^ Notes ^^ ---
--- --- U will need a folder named TxtIntros in the  ' scripts ' folder and the corresponding files ... ( just create some new txts and rename them )
--- --- of your PtokaX folder ( is in the same place where  PtokaX.exe is found  )
--- --- Pls keep in mind that the profiles used are for the default ( 0 - 4 )
--- --- Remedy for any profile configuration besides the default is possible, but I don't have time for that .. :P ( look in scripting.txt and use imagination ... Hint : PtokaX's Profile Functions )


botsName = "NewsForYou" --- this is the variable we will be using for the Name of the bot ...  ( it needs to be registered because it needs to appear online to send PM ... )
--- --- This can be changed to whatever u want ...  :D

tProfiles = {
["Master"] = "TxtIntros/Master.txt", --- Master Profile Number is : 0 --- You can add more profiles here ...
["Operator"] = "TxtIntros/Operators.txt", --- Op Profile Number is : 1 --- or modify these to match your own profile names ...
["Vip"] = "TxtIntros/VIP.txt", --- Vip Profile Number is : 2 --- just remember to keep the  ["ProfileName"] = "path/path.txt" format
["Reg"] = "TxtIntros/Reg.txt", --- Reg Profile Number is : 3
};

function Main()
frmHub:UnregBot(botsName) --- Unreg the Bot from the NickList, ( using the string defined by the ' botsName ' value )
frmHub:RegBot(botsName) --- and Register it again ... ( using the string defined by the ' botsName ' value, again )
end

function OpConnected(user)
NewUserConnected(user)
end

function NewUserConnected(user)
for prName, txtfile in tProfiles do --- for every index ( represented by variable "prName", in this case) and its responding value in the Table ( tprofiles, in this case )
if ( GetProfileName(user.iProfile) == prName ) then   --- --- if the profile Name returned by PtokaX's GetProfileName(profile_idx) function** matches the prName variable string in the table then
--- --- ** ( get's profile name by profile index=[number])
user:SendPM(botsName, ReadTextFile(txtfile)) --- --- send a PM to the user from "botsName" with the data returned by the action in the "action" ( stated as responding value above )
end --- --- end of the ' if ' statement
end --- end of the ' for ' statement
end --- end of the function

function ReadTextFile(file)
local message = "\r\n" --- a local variable* will hold the message that will be formed
readfrom(file, "r") --- input defined from variable " file " and on read mode (the "r" part)
while 1 do --- if there is data in a line
local line = read() --- then get this data ( locally, since it is for using it in this loop only )
if ( line == nil ) then break --- --- note that if data from a line does not exist then break our loop
else message = message..line.."\r\n" --- --- in any other case, add it up to our msgdata* ( also using "\r\n" that is in essense a new line )
end --- --- end of the if statement
end --- end of the ' while ' loop statment
readfrom() --- return the input to the default ( stdin )
return message --- give us the msgdata*
end --- end the function
Title: thanx
Post by: (????H??v?????v?L????) on 07 July, 2004, 23:54:44
Hi m8,

thanx for that script, not tested it yet but looks like what i am looking for :)
Title:
Post by: plop on 07 July, 2004, 23:55:27
QuoteOriginally posted by ((UKSN))shad_dow
LO Plop see u beat me to it again PMFSL

yours shad
i can edit my post if you want. lol

@ (????H??v?????v?L????): weird never heard any1 having this problem.
would you have some more info like the client you use??

plop
Title:
Post by: Herodes on 07 July, 2004, 23:59:26
QuoteOriginally posted by (????H??v?????v?L????)
Hi m8,

thanx for that script, not tested it yet but looks like what i am looking for :)
I tested , it works .. :D
Just be sure you create the folder and the files the script is going for ..

I thought it would be easy to go to sleep ... but i couldn't resist to an easy post .. Lol

going offline  . .
Title:
Post by: (????H??v?????v?L????) on 08 July, 2004, 00:06:04
[/QUOTE]

@ (????H??v?????v?L????): weird never heard any1 having this problem.
would you have some more info like the client you use??

plop
[/QUOTE]

Hi m8 i just changed over to StrongDC
Title:
Post by: plop on 08 July, 2004, 03:26:42
QuoteOriginally posted by (????H??v?????v?L????)
Hi m8 i just changed over to StrongDC
mutor just tested it for me and it worked fine.

plop
Title:
Post by: (????H??v?????v?L????) on 08 July, 2004, 23:18:17
QuoteOriginally posted by (????H??v?????v?L????)
Hi again,

Thanx Shad and Plop for the fast answers and help :)

I have 1 prob with the script, Every time i type +help in pm to the bot it disconnect's me


sorry it was a client prob lol