Random Intro/Outro
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Random Intro/Outro

Started by pHaTTy, 16 February, 2004, 03:42:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pHaTTy

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 ;)
Resistance is futile!

pHaTTy

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
Resistance is futile!

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
//NL

pHaTTy

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 ;)
Resistance is futile!

pHaTTy

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?
Resistance is futile!

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
//NL

pHaTTy

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....
Resistance is futile!

NightLitch

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... :-)
//NL

pHaTTy

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)
Resistance is futile!

NightLitch

Yes but what about when having this:

curUser:SD(BotName,"You share "..UserGB/gb.." Gb")
//NL

pHaTTy

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")
Resistance is futile!

NightLitch

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.
//NL

pHaTTy

hmm depends on how many [] u gonna have per line but yep shud work :)
Resistance is futile!

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 ??
//NL

NightLitch

sorry btw for messing up this thread... but you can delete this after I get it... :-) hope you don't mind.
//NL

pHaTTy

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
Resistance is futile!

pHaTTy

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
Resistance is futile!

NightLitch

this worked:
function Lang(string,value)
--		dostring(string)
		lang=gsub(string,"%b[]", value)
	return lang
end

but not yours... that I find strange.
//NL

pHaTTy

hmmm :s ok well as long as u got it working eh :)
Resistance is futile!

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
//NL

pHaTTy

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
Resistance is futile!

NightLitch

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"
//NL

pHaTTy

hmm not to sure im newbie to gsub :)
Resistance is futile!

DorianG

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???

DorianG

Sorry i have tried my error  :D

frmHub:GetHubName()

SMF spam blocked by CleanTalk