random intro message bot i wrote for gekko here is the source ;) was wrote a while back, just frgot to write as a stand alone ;)
--//Random In/Out(tro) bot By Phatty
dBot = "GeX"
function OpConnected(user)
reply = Random(user)
SendToAll(dBot,reply)
end
function Random(user)
test = random(9)
x1 = user.sName.." appears from the darkness"
x2 = user.sName.." walks out from the darkness"
x3 = "ALL YOUR BASE ARE BELONG TO "..user.sName
x4 = user.sName.." walks in covered in something"
x5 = user.sName.." blah"
x6 = user.sName.." more blah"
x7 = user.sName.." some more blah"
x8 = user.sName.." blah blah"
x9 = user.sName.." even more blah"
dostring("ret=x"..test)
return ret
end
enjoy ;)
update
--//Random In/Out(tro) bot By Phatty
--//RINOUR(TRO) v1.01
howmany = "3" --set to how many x1,2,3,4,5 u have
--//start here x1,x2,x3 etc
x1 = "[USER] appears from the darkness"
x2 = "[USER] walks out from the darkness"
x3 = "ALL YOUR BASE ARE BELONG TO [USER]"
--//end
dBot = "GeX"
function OpConnected(user)
reply = Random(user)
SendToAll(dBot,reply)
end
function Random(user)
test = random(howmany)
dostring("ret=x"..test)
ret=gsub(ret,"%b[]", user.sName)
return ret
end
Nice Phatty, but a question for my bot.
Can I use the same principal for creating my multilang ??
or how have you all done it ??
wanna now plz.
/NL
QuoteOriginally posted by NightLitch
Nice Phatty, but a question for my bot.
Can I use the same principal for creating my multilang ??
or how have you all done it ??
wanna now plz.
/NL
using dostring yes ;)
QuoteOriginally posted by NightLitch
Nice Phatty, but a question for my bot.
Can I use the same principal for creating my multilang ??
or how have you all done it ??
wanna now plz.
/NL
altho it depends on what you are doing, like most bots just have the hub language, Gekko and ChannelBot have user language
so each user may choose a language, which are you trying to get to?
How should I say it hmm;
I want HubOwners to select their language for the script.
I want to make a Langfile.lan with all my text from the bot. is that good enough explaination ?
Seperatly for each user I will look at later now this is my main, priority, have solved the table structuring for the commands, but the lang. is left to do.
thx for the help Phatty.
/NL
QuoteOriginally posted by NightLitch
How should I say it hmm;
I want HubOwners to select their language for the script.
I want to make a Langfile.lan with all my text from the bot. is that good enough explaination ?
Seperatly for each user I will look at later now this is my main, priority, have solved the table structuring for the commands, but the lang. is left to do.
thx for the help Phatty.
/NL
well for owners todo it, u might as well add for all users cause otherwise it means more code....
hehe you missunderstod me.
I mean the hubowner select in the script with will be the lang. for all. not only for him. or what?? hehe little dizzy here... :-)
oh ok, well in that case just use strings, so every phrase in script change with for example
SendToAll(Bot,"some tosser named eternal flame is a dumbass")
change to
--lan file
DumbAss = "some tosser named eternal flame is a dumbass
--dofile this file ;)
SendToAll(Bot,DumbAss)
Yes but what about when having this:
curUser:SD(BotName,"You share "..UserGB/gb.." Gb")
QuoteOriginally posted by NightLitch
Yes but what about when having this:
curUser:SD(BotName,"You share "..UserGB/gb.." Gb")
well u can use gsub for that ;) altho for that
curUser:SD(BotName,"You share "..UserGB/gb.." Gb")
word = "You Share "
curUser:SD(BotName,word..UserGB/gb.." Gb")
I was thinking with a function like this:
function Lang(string,value)
dostring(string)
lang=gsub(string,"%b[]", value)
return lang
end
but don't know if it work as it should becouse haven't tested it yet.
hmm depends on how many [] u gonna have per line but yep shud work :)
Getting error why:
function OpConnected(curUser)
TEST = "Test to [USER] if gsub text"
curUser:SendData(BotName,"TEst to "..curUser.sName.." regual text")
lang = Lang(TEST,curUser.sName)
curUser:SendData(BotName,lang)
end
function Lang(string,value)
dostring(string)
lang=gsub(string,"%b[]", value)
return lang
end
ERROR:
Syntax error: `=' expected;
last token read: `to' at line 1 in string "Test to [USER] if gsub text"
stack traceback:
1: function `dostring' [C]
2: function `Lang' at line 982 [file `C:\PtokaX\scripts\NXS-3.lua']
3: function `OpConnected' at line 258 [file `C:\PtokaX\scripts\NXS-3.lua']
why bro ??
sorry btw for messing up this thread... but you can delete this after I get it... :-) hope you don't mind.
QuoteOriginally posted by NightLitch
Getting error why:
function OpConnected(curUser)
TEST = "Test to [USER] if gsub text"
curUser:SendData(BotName,"TEst to "..curUser.sName.." regual text")
lang = Lang(TEST,curUser.sName)
curUser:SendData(BotName,lang)
end
function Lang(string,value)
dostring(string)
lang=gsub(string,"%b[]", value)
return lang
end
ERROR:
Syntax error: `=' expected;
last token read: `to' at line 1 in string "Test to [USER] if gsub text"
stack traceback:
1: function `dostring' [C]
2: function `Lang' at line 982 [file `C:\PtokaX\scripts\NXS-3.lua']
3: function `OpConnected' at line 258 [file `C:\PtokaX\scripts\NXS-3.lua']
why bro ??
because dostring has tobe a string like test= something
like errmuhmm
function OpConnected(curUser)
TEST = "Test to [USER] if gsub text"
curUser:SendData(BotName,"TEst to "..curUser.sName.." regual text")
lang = Lang(TEST,curUser.sName)
curUser:SendData(BotName,lang)
end
function Lang(string,value)
dostring("xl="..string)
lang=gsub(xl,"%b[]", value)
return xl
end
this worked:
function Lang(string,value)
-- dostring(string)
lang=gsub(string,"%b[]", value)
return lang
end
but not yours... that I find strange.
hmmm :s ok well as long as u got it working eh :)
Yepp, if I get errors I blame on you then ;-p hehe...
No, Thx for the help bro, And must say, Am glad you're still here.
You where about to leave us. But we pulled you back here. :-)
Have a nice day m8 / NL
QuoteOriginally posted by NightLitch
Yepp, if I get errors I blame on you then ;-p hehe...
No, Thx for the help bro, And must say, Am glad you're still here.
You where about to leave us. But we pulled you back here. :-)
Have a nice day m8 / NL
ye lol i still really need toleave its just hard thing todo
How should it be if I want to values:
ex:
function Lang(string,value1,value2)
lang=gsub(string,"%b[]", value1)
return lang
end
for ex:
curUser:SendData(BotName,curUser.sName.." you are sharing "..UserShare/gb.." Gb")
Line = "[USER] you are sharing [SHARE] Gb"
hmm not to sure im newbie to gsub :)
Sorry phatty i have used this code:
function Opconnected(user)
reply = Random(user)
SendToAll(BotName,reply)
end
function RandomOpMsg(user)
test = random(nummsgop)
x1 = user.sName.." appare dalle tenebre"
x2 = user.sName.." esce fuori da una nube proprio come fanno i ninja"
x3 = "La sua fama lo precede, ? tra noi "..user.sName
x4 = "Tutti lo conoscono tutti ci hanno parlato, ma nessuno in realt? sa chi si cela dientro "..user.sName
x5 = user.sName.." ? entrato, state attenti faker"
x6 = user.sName.." ? qui tra noi, non so voi ma io scappo :D"
x7 = user.sName.." ? arrivato miticooooooooooooo"
x8 = user.sName.." spalanca le porte di "..frmHub:GetHubName().." e con il suo scettro da operatore si prepara a distruggere i faker"
x9 = user.sName.." arriva col suo elicottero e atterra su " ..frmHub:GetHubName
dostring("ret=x"..test)
return ret
end
But Ptokax tell me: Syntax error: function arguments expected;
last token read: `dostring' at line 18 in string "function Opconnected(user)
..."
Why???
Sorry i have tried my error :D
frmHub:GetHubName()
Hi
Great Script.
I was wondering if u could make it to say the Intro/Outro Messege for only users. And not for Vip/Ops.
Please =)
QuoteOriginally posted by madman
Hi
Great Script.
I was wondering if u could make it to say the Intro/Outro Messege for only users. And not for Vip/Ops.
Please =)
--//Random In/Out(tro) bot By Phatty
--//RINOUR(TRO) v1.01
howmany = "3" --set to how many x1,2,3,4,5 u have
--//start here x1,x2,x3 etc
x1 = "[USER] appears from the darkness"
x2 = "[USER] walks out from the darkness"
x3 = "ALL YOUR BASE ARE BELONG TO [USER]"
--//end
dBot = "GeX"
function NewUserConneced(user)
if user.iProfile == -1 then
reply = Random(user)
SendToAll(dBot,reply)
end
end
function Random(user)
test = random(howmany)
dostring("ret=x"..test)
ret=gsub(ret,"%b[]", user.sName)
return ret
end
enjoy ;)
Hi
I can the OP script to work but not the user script. It dosent say anything when a new user connect....