PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Krysalis on 10 June, 2005, 12:59:24

Title: [Request] Multiple Botdescription
Post by: Krysalis on 10 June, 2005, 12:59:24
Hello,

i search for a multiple Bot description Script.
There is still on in Lua 4. Dont know Autor @ Moment.
In this script u can set any bots description, tag, email, connection.
But always for one Bot.
Is this possible to make ONE script, where u can set this settings for all Bots?

like:

Botname1="Bot1"
Description=""
Tag=""
Email=""
Speed=""

Botname2="Bot2"
Description=""
Tag=""
Email=""
Speed=""

Botname3="Bot3"
Description=""
Tag=""
Email=""
Speed=""

info should be resend every 15 Minutes.
Thanks in Advance


Title:
Post by: Dessamator on 10 June, 2005, 14:41:00
yap just add a timer, see the howto section , but im not so sure u need to resend the info the bot dont really change u only need to set it once !
Title:
Post by: jiten on 10 June, 2005, 15:07:30
Maybe this one:
-- Script For Bot Description
-- Converted to lua 5 by Madman
-- Optimized some...

Bot = {
["Name"] = "(•???†•)M?3?T?g?™",
["Email"] = "HubMp3World@hotmail.com",
["Descr"] = "? [??] k s okupa do Hu? em geral ?",
["Speed"] = "Bot",
["Share"] = 1024 * 1024 * 1024,
}
Bot2 = {
["Name"] = "(•???†•)M?3?i?™",
["Email"] = "HubMp3World@hotmail.com",
["Descr"] = "? [??] k filtra os IPs permitidos no Hu? ? ",
["Speed"] = "Bot",
["Share"] = 1024 * 1024 * 1024,
}
Bot3 = {
["Name"] = "(•???†•)M?3?Ch?t™",
["Email"] = "HubMp3World@hotmail.com",
["Descr"] = "? [??] Chat dos Operadores ?",
["Speed"] = "Bot",
["Share"] = 1024 * 1024 * 1024,
}
Bot4 = {
["Name"] = "(•???†•)M?3????",
["Email"] = "HubMp3World@hotmail.com",
["Descr"] = "? [??] k verifika kem faz PU? ? ",
["Speed"] = "Bot",
["Share"] = 1024 * 1024 * 1024,
}

function Main()
frmHub:RegBot(Bot.Name)
MyInfoString = "$MyINFO $ALL "..Bot.Name.." "..Bot.Descr.."$ $"..Bot.Speed..string.char(1).."$"..Bot.Email.."$"..Bot.Share.."$"
SendToAll(MyInfoString)

frmHub:RegBot(Bot2.Name)
MyInfoString2 = "$MyINFO $ALL "..Bot2.Name.." "..Bot2.Descr.."$ $"..Bot2.Speed..string.char(1).."$"..Bot2.Email.."$"..Bot2.Share.."$"
SendToAll(MyInfoString2)

frmHub:RegBot(Bot3.Name)
MyInfoString3 = "$MyINFO $ALL "..Bot3.Name.." "..Bot3.Descr.."$ $"..Bot3.Speed..string.char(1).."$"..Bot3.Email.."$"..Bot3.Share.."$"
SendToAll(MyInfoString3)

frmHub:RegBot(Bot4.Name)
MyInfoString4 = "$MyINFO $ALL "..Bot4.Name.." "..Bot4.Descr.."$ $"..Bot4.Speed..string.char(1).."$"..Bot4.Email.."$"..Bot4.Share.."$"
SendToAll(MyInfoString4)
end

function NewUserConnected(user)
user:SendData(MyInfoString)
user:SendData(MyInfoString2)
user:SendData(MyInfoString3)
user:SendData(MyInfoString4)
end

OpConnected = NewUserConnected
Title:
Post by: Dessamator on 10 June, 2005, 15:57:18
that script has quite a looooot of repitition, could be resolved with a simple function !
Title:
Post by: jiten on 10 June, 2005, 17:31:49
QuoteOriginally posted by Dessamator
that script has quite a looooot of repitition, could be resolved with a simple function !
Indeed it has, as I only pasted the original code.
Maybe later I'll touch it a bit ;)

Cheers
Title:
Post by: Krysalis on 10 June, 2005, 18:51:50
The i will wait for your "moddet" Version, Jiten ;-)
Title:
Post by: Krysalis on 10 June, 2005, 19:22:14
Sorry,

At the Moment i see that i use the wrong forum. I would post into Lua5 Section....can any Mod move this?
Title:
Post by: jiten on 10 June, 2005, 22:12:56
Here goes my try:
-- Script For Bot Description
-- Converted to lua 5 by Madman
-- Touched a bit by jiten

iDelay = 15 -- Delay between MyINFO Sending

tBots = {
{ Name = "bot1", Email = "mail1", Descr = "desc1", Share = 1024*1024*1024, },
{ Name = "bot2", Email = "mail2", Descr = "desc2", Share = 1024*1024*1024, },
{ Name = "bot3", Email = "mail3", Descr = "desc3", Share = 1024*1024*1024, },
{ Name = "bot4", Email = "mail4", Descr = "desc4", Share = 1024*1024*1024, },
}

Main = function()
for i = 1, table.getn(tBots) do
frmHub:RegBot(tBots[i]["Name"])
SendToAll("$MyINFO $ALL "..tBots[i]["Name"].." "..tBots[i]["Descr"].."$ $"..string.char(1).."$"..tBots[i]["Email"].."$"..tBots[i]["Share"].."$")
end
SetTimer(60*1000*iDelay) StartTimer()
end

OnTimer = Main
Best regards,

jiten
Title:
Post by: Dessamator on 11 June, 2005, 11:48:00
yap thats the way, clean clean clean :)
Title:
Post by: Krysalis on 11 June, 2005, 15:26:25
Many thx as always, Jiiten;-)
Title:
Post by: Krysalis on 30 June, 2005, 21:50:38
Hello:)

can you add "Tag" and "Connection" please?

And if is possible to insert cmds for changing descriptions while scripts running?

Greets
Title:
Post by: jiten on 04 July, 2005, 12:03:13
Try using this although there's no difference with the previous one (just removed some stuff). Btw, you can insert the tag right next to the description.
-- Script For Bot Description
-- Converted to lua 5 by Madman
-- Touched a bit by jiten

iDelay = 15 -- Delay between MyINFO Sending

tBots = {
{ "bot1", "mail1", "desc1<++ V:0.668,M:A,H:0/0/1,S:1>", 1024*1024*1024, },
{ "bot2", "mail2", "desc2<++ V:0.668,M:A,H:0/1/1,S:1>", 1024*1024*1024, },
{ "bot3", "mail3", "desc3<++ V:0.668,M:A,H:0/1/1,S:1>", 1024*1024*1024, },
{ "bot4", "mail4", "desc4<++ V:0.668,M:A,H:0/1/1,S:1>", 1024*1024*1024, },
}

Main = function()
for i = 1, table.getn(tBots) do
frmHub:RegBot(tBots[i][1])
SendToAll("$MyINFO $ALL "..tBots[i][1].." "..tBots[i][3].."$ $"..string.char(1).."$"..tBots[i][2].."$"..tBots[i][4].."$")
end
SetTimer(60*1000*iDelay) StartTimer()
end

OnTimer = Main