Forums
Teamfair Developer for all Hobby coders. :: Forums :: Programming and Protocol :: MPPS (Multi Protocol Plateform Server)
 
<< Previous thread | Next thread >>
I am looking fore a Voltorn script
Go to page       >>  
Moderators: NeiSep, b_w_johan, Rajeev
Author Post
Psvoo7
Thu Aug 18 2005, 10:11PM
Registered Member #17
Joined: Thu Aug 18 2005, 09:50PM
Posts: 7
I am looking fore a Voltorn script &|
Do a body have somone fore me?
Back to top
b_w_johan
Thu Aug 18 2005, 10:18PM

Registered Member #7
Joined: Fri Jul 08 2005, 03:31PM
Posts: 154
--copy from line below here
-- made by b_w_johan 15-8-05
-- v5

-- load files --
--loadScript("name.lua")

-- declaraties --
b_w = {}
b_w.Name = "Guard" -- place here botname
b_w.Disc = "By b_w_johan 4 BN^_ " -- put here discriptrion + tag
b_w.mail = "dc.client@gmail.com" -- put email adres here
b_w.ownt = "b_w_johan" -- place the name of hubowner here

-- bij starten --
setArrival("OnStartup", function()
SendToAll(b_w.Name, "de bot is net gestart") -- send message on startup
RegBot(b_w.Name, b_w.Disc, b_w.mail) -- add bot to userlist
end)

setArrival("UserConnected", function(user, msg)
SendToAll(b_w.Name, ""..user.sName.." is zojuist de hub binnengeslopen...") -- if user enters send message
end)

setArrival("OpConnected", function(user, msg)
if user.sName == b_w.ownt then -- if owner enters send
SendToAll(b_w.Name, "De owner enterde")
else
SendToAll(b_w.Name, "de operator "..user.sName.." is zojuist de hub binnengeslopen...") -- if OPerator enters send:
end
end)

setArrival("ChatArrival", function(user,msg)
msg = string.gsub(msg, "(%S+)",
function(word)
if word == "!test" then
SendToAll(b_w.Name, "TEST SUCCEEDED") -- this happens by !test
return 1
elseif word == "!clear" then
SendToAll(user.sName, "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ") -- this clears mainchat every \r\n is 1 enter
end
end)
end)

--copy till the line above here open notepad and save as "guard.lua" in the script folder of Voltron

--im not sure if this is what youre looking for but this is a basic for making a bot, be more specific in what you want and i can make it like you want now its only a welcome bot
Back to top
Psvoo7
Thu Aug 18 2005, 10:25PM
Registered Member #17
Joined: Thu Aug 18 2005, 09:50PM
Posts: 7
Tnx!
But its for me not ready...
Do you know how i can make that he send the rules!?!
And a help menu!:)

Psvoo7
Back to top
NeiSep
Thu Aug 18 2005, 10:33PM

Registered Member #1
Joined: Fri Jun 24 2005, 12:36AM
Posts: 161
You could make a array for rules or make the script read from a file when you hit +rules or what command you want to have hehe.


rules = {"ALOT OF RULES HERE"}
if word == "!rules" then
SendToAll(b_w.Name, "..rules..") 
return 1 

Forgeted 2 ..
hehe i think that would work
[ Edited Thu Aug 18 2005, 11:38PM ]
Back to top
Psvoo7
Thu Aug 18 2005, 10:44PM
Registered Member #17
Joined: Thu Aug 18 2005, 09:50PM
Posts: 7
Thats great Thanks:)
I Gonna try it now:D
Back to top
NeiSep
Fri Aug 19 2005, 12:03AM

Registered Member #1
Joined: Fri Jun 24 2005, 12:36AM
Posts: 161
ok let me know if its working or not
Back to top
b_w_johan
Fri Aug 19 2005, 10:23AM

Registered Member #7
Joined: Fri Jul 08 2005, 03:31PM
Posts: 154
--copy from line below here
-- made by b_w_johan 15-8-05
-- v6

-- declaraties --
b_w = {}
b_w.Name = "Guard" -- place here botname
b_w.Disc = "By b_w_johan 4 BN^_ " -- put here discriptrion + tag
b_w.mail = "dc.client@gmail.com" -- put email adres here
b_w.ownt = "b_w_johan" -- place the name of hubowner here
b_w.rule = "ALOT OF RULES HERE \r\n every line ends with \r\n so you can start a new one." -- place youre rules here.


-- bij starten --
setArrival("OnStartup", function()
SendToAll(b_w.Name, "de bot is net gestart") -- send message on startup
RegBot(b_w.Name, b_w.Disc, b_w.mail) -- add bot to userlist
end)

setArrival("UserConnected", function(user, msg)
SendToAll(b_w.Name, ""..user.sName.." is zojuist de hub binnengeslopen...") -- if user enters send message
end)

setArrival("OpConnected", function(user, msg)
if user.sName == b_w.ownt then -- if owner enters send
SendToAll(b_w.Name, "De owner enterde")
else
SendToAll(b_w.Name, "de operator "..user.sName.." is zojuist de hub binnengeslopen...") -- if OPerator enters send:
end
end)

setArrival("ChatArrival", function(user,msg)
msg = string.gsub(msg, "(%S+)",
function(word)
if word == "!test" then
SendToAll(b_w.Name, "TEST SUCCEEDED") -- this happens by !test
return
elseif word == "!clear" then
SendToAll(user.sName, "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ") -- this clears mainchat every \r\n is 1 enter
return
elseif word == "!rules" then
SendToAll(b_w.Name, b_w.rule) -- if its yust only the declaration from above no ".. .." needed ... but if you do it with .. you shoould add "".. .."" wich meens you add txt command txt and the txt parts are empty so it can be left away.
return
end
end)
end)

--copy till the line above here open notepad and save as "guard.lua" in the script folder of Voltron



ok its weird cause:
b_w.rule = {
"text line1",
"text line2".
}

should have been working to... but then its yust not sending...
so here is a middle solution .. if it starts working ill post again.
[ Edited Fri Aug 19 2005, 01:19PM ]
Back to top
b_w_johan
Fri Aug 19 2005, 10:24AM

Registered Member #7
Joined: Fri Jul 08 2005, 03:31PM
Posts: 154
i hate this ... now it put it in the code tags .. but stil my tabs are stolen ...... neisep whats that ???
Back to top
Psvoo7
Fri Aug 19 2005, 10:25AM
Registered Member #17
Joined: Thu Aug 18 2005, 09:50PM
Posts: 7
Thats great to!I go try it out in my script:)!
Thanks Johan and NeiSep! :p

Psvoo7 !dodge
Back to top
b_w_johan
Fri Aug 19 2005, 10:29AM

Registered Member #7
Joined: Fri Jul 08 2005, 03:31PM
Posts: 154
trying to figure out how to read from file now =-p
[ Edited Fri Aug 19 2005, 12:35PM ]
Back to top
Go to page       >>   

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System
This site is powered by e107, which is released under the terms of the GNU GPL License.