---------------------------------------------------
-- Botname = [Police]
-- Welcome info
-- made by kepp
---------------------------------------------------
B = "[Police]"
SirYesSir = "Now Get Back To Work!"
opleave = "Where do you think you are going"
Gb = "Get Back Now!"
function NewUserConnected(curUser)
if curUser.bOperator then
return 1
else
curUser:SendData("_____________________________________________")
curUser:SendData("")
curUser:SendData("")
curUser:SendData("")
curUser:SendData("Your Name: "..curUser.sName)
curUser:SendData("")
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("")
curUser:SendData("Your Version: "..curUser.iVersion)
curUser:SendData("")
curUser:SendData("Your Profile: "..curUser.iProfile)
curUser:SendData("-1 = A normal user")
curUser:SendData("0 = Master")
curUser:SendData("1 = OP")
curUser:SendData("2 = VIP")
curUser:SendData("3 = REG")
curUser:SendData("")
curUser:SendData("")
curUser:SendData("_____________________________________________")
end
end
function OpConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("")
curUser:SendData("")
curUser:SendData("Your Profile: "..curUser.iProfile)
curUser:SendData("")
curUser:SendData("-1 = A normal user")
curUser:SendData("0 = Master")
curUser:SendData("1 = OP")
curUser:SendData("2 = VIP")
curUser:SendData("3 = REG")
curUser:SendData("")
curUser:SendData("Your IP: "..curUser.sIP)
SendToAll(B, "Hey "..curUser.sName.." "..SirYesSir)
end
function OpDisconnected(curUser)
SendToAll(B, "..opleave.. "..curUser.sName.." ? "..Gb)
end
hmm most users already know their own nick and IP
and how about using GetProfileName() instead of listing all the profiles?
hmm, yea, Im a newbie at scripting, trying to learn!
How ami suppose to add that?
"Your profile: "..(GetProfileName(user.iProfile) or "Unregistered")
Thank you, Im starting to learn now! :)
May i aslo ask how to se the The current share amount in GB/Tb, and same thing Minimum share!!
Thanks =)
-------------------
-- Info on connect
-- Made By Kepp
-- 03/10/30
-------------------
sBot = "[Police]"
SirYesSir = "Now Get Back To Work!"
opleave = "Where do you think you are going"
Gb = "Get Back Now!"
function Main()
frmHub:GetMinShare()
frmHub:GetCurrentShareAmount()
frmHub:GetHubName()
frmHub:GetUsersCount()
end
function NewUserConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("")
curUser:SendData("Welcome To: "..frmHub:GetHubName().."")
curUser:SendData("")
curUser:SendData("Your Name: "..curUser.sName)
curUser:SendData("")
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("")
curUser:SendData("Your Version: "..curUser.iVersion)
curUser:SendData("")
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("")
curUser:SendData("Total online users: "..frmHub:GetUsersCount().."")
curUser:SendData("")
curUser:SendData("Minimum Share for you: "..frmHub:GetMinShare().."")
curUser:SendData("")
curUser:SendData("Total Share: "..frmHub:GetCurrentShareAmount().."")
curUser:SendData("")
curUser:SendData("_____________________________________________")
end
function OpConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("")
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("")
curUser:SendData("Your IP: "..curUser.sIP)
SendToAll(sBot, "Hey "..curUser.sName..", "..SirYesSir)
end
function OpDisconnected(curUser)
SendToAll(sBot, opleave.." "..curUser.sName.." ? "..Gb)
end
the min/total share amounts come to you in bytes..
so youll have to keep dividing by 1024 to get kB MB GB TB
and use format("%.2f", minshare) for rounding to two decimal places
few more things..
your function Main() doesnt do anything and you forgot to END it
this way NewUserConnected() will never get called
and theres no need to check if user.bOperator.. its never true
user:SendData("") doesnt do anything either
Allright, change is made!
I have alot to learn!!
something like this?
-------------------
-- Info on connect
-- Made By Kepp
-- 03/10/30
-------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
tb = kb*kb*kb*kb
sBot = "[Police]"
SirYesSir = "Now Get Back To Work!"
opleave = "Where do you think you are going"
Gb = "Get Back Now!"
gSM = frmHub:GetMinShare()/(1024)
function Main()
frmHub:GetMinShare()
frmHub:GetCurrentShareAmount()
frmHub:GetHubName()
frmHub:GetUsersCount()
end
function NewUserConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("")
curUser:SendData("Welcome To: "..frmHub:GetHubName().."")
curUser:SendData("")
curUser:SendData("Your Name: "..curUser.sName)
curUser:SendData("")
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("")
curUser:SendData("Your Version: "..curUser.iVersion)
curUser:SendData("")
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("")
curUser:SendData("Total online users: "..frmHub:GetUsersCount().."")
curUser:SendData("")
curUser:SendData("Minimum Share for you: "..gSM.."")
curUser:SendData("")
curUser:SendData("Total Share: "..frmHub:GetCurrentShareAmount().."")
curUser:SendData("")
curUser:SendData("_____________________________________________")
end
function OpConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("")
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("")
curUser:SendData("Your IP: "..curUser.sIP)
SendToAll(sBot, "Hey "..curUser.sName..", "..SirYesSir)
end
function OpDisconnected(curUser)
SendToAll(sBot, opleave.." "..curUser.sName.." ? "..Gb)
end
Can you try to explain with maybe a few lines of codes how to do.... to set the Current share amount to TB?
kepp as you wanne learn i'm just gone give you a hint.
check this line from your script.
gSM = frmHub:GetMinShare()/(1024)
plop
hmm, he he, this topic shouln't be in finished !! :)
Hey plop, i did try to do the same thing with
frmHub:GetCurentShareAmount()/(1024)
But the result was just a bunch of numbers!
:S
QuoteOriginally posted by kepp
hmm, yea, Im a newbie at scripting, trying to learn!
How ami suppose to add that?
hmmm if ur a newbie its not bad, pretty good for newbie :o)
why
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
???
curUser:SendData("Your Profile: "..curUser.iProfile)
l8rr,,
i thought it was clear.. and would make more sense to show the name of the profile instead of numbers that dont really say much to the user
..
ooops yep sorry ;)
so you cud do
index= user.iProfile
msg = Bot,"Your profile is : "..GetProfileName(index)
user:SendData(Bot,msg)
does just the same hehehe
hehe l8rr,,
sure.. but what you just wrote
1. will choke on unregged users and throw a concat error (GetProfileName returns nil)
2. takes one local variable and two lines of code more than it has to
QuoteOriginally posted by kepp
hmm, he he, this topic shouln't be in finished !! :)
Hey plop, i did try to do the same thing with
frmHub:GetCurentShareAmount()/(1024)
But the result was just a bunch of numbers!
:S
it comes in bytes 2.
you gotta take it a couple steps further.
share/1024 = KB
share/1024/1024 = MB
etc.
you whill end up with a lot of number behind the . that can be solved with this.
share = format("%0.2f", share)
as a result you'll get max 2 numbers behind the .
i didn't use frmHub:GetCurrentShareAmount() in this example on purpose, if you now look closely you can see that you can make 1 line out of it 2 get the share in TB's.
good luck your doing great so far.
plop
-------------------
-- Info on connect
-- Made By Kepp
-- 03/10/30
-------------------
kb = 1024
mb = 1024/1024
sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
sBot = "[Police]"
SirYesSir = "Now Get Back To Work!"
opleave = "Where do you think you are going"
Gb = "Get Back Now!"
gSM = frmHub:GetMinShare()/(1024)
woo = format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024)
function Main()
frmHub:GetMinShare()
frmHub:GetCurrentShareAmount()
frmHub:GetHubName()
frmHub:GetUsersCount()
end
function NewUserConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("Welcome To: "..frmHub:GetHubName().."")
curUser:SendData("Your Name: "..curUser.sName)
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("Your Version: "..curUser.iVersion)
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("Total online users: "..frmHub:GetUsersCount().."")
curUser:SendData("Minimum Share for you: "..gSM.." GB")
curUser:SendData("Total Share: "..woo.." TB")
curUser:SendData("_____________________________________________")
end
function OpConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile)")
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("_____________________________________________")
SendToAll(sBot, "Hey "..curUser.sName..", "..SirYesSir)
end
function OpDisconnected(curUser)
SendToAll(sBot, opleave.." "..curUser.sName.." ? "..Gb)
end
hmm, spent 3-4 hours figuring this out:
woo = format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024)
Thanks alot.... :)
This is fun, Anything else? he he
good job just you got it in GB now.
how about making the bot pick what 2 use.
if the total share is below 1 TB making it shows in GB.
your gone need this for it.
strlen(share) ?? ?
the ?? should be replaced by something wich compairs.
the ? by a number.
look back 2 what tezlo sayd.
you can remove some part because it doesn't do anything.
and a operator is always registered, so this line can be done faster.
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
good luck
plop
Removed lines i didn't need!
i have no idea how to do that! i've read The LUA manual,
i don't get it ?(
this part.
function Main()
frmHub:GetMinShare()
frmHub:GetCurrentShareAmount()
frmHub:GetHubName()
frmHub:GetUsersCount()
end
it doesn't do anything.
you get some vallue's from the hub on startup but you don't do anything with it.
you can remove it completly.
take a look @ this book (http://www.inf.puc-rio.br/~roberto/luabook1.pdf).
i find it much more helpfull then the reference manual.
with that book you must be able 2 find out how 2 make the bot choose between GB and TB.
i'll give 1 more hint.
calculate the total share in GB and check how much numbers you get.
plop
Found strlen(s) in both manuals.
but i have no idea what to do, Anyway,
removed those lines,
doh, ofcorse i don't need them :)
I call them from curUser:SendData()
but, i can allways add RegBot() :)
-------------------
-- Info on connect
-- Made By Kepp
-- 03/10/30
-------------------
kb = 1024
mb = 1024/1024
Sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
sBot = "[Police]"
SirYesSir = "Now Get Back To Work!"
opleave = "Where do you think you are going"
Gb = "Get Back Now!"
gSM = frmHub:GetMinShare()/(1024)
woo = format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024)
function Main()
frmHub:RegBot(sBot)
end
function NewUserConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("Welcome To: "..frmHub:GetHubName().."")
curUser:SendData("Your Name: "..curUser.sName)
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("Your Version: "..curUser.iVersion)
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("Total online users: "..frmHub:GetUsersCount().."")
curUser:SendData("Minimum Share for you: "..gSM.." GB")
curUser:SendData("Total Share: "..woo.." TB")
curUser:SendData("_____________________________________________")
end
function OpConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("_____________________________________________")
SendToAll(sBot, "Hey "..curUser.sName..", "..SirYesSir)
end
function OpDisconnected(curUser)
SendToAll(sBot, opleave.." "..curUser.sName.." ? "..Gb)
end
Nice to see brains in action.
I can see this for a "make your own bot" n? 5 ;)
QuoteOriginally posted by OpiumVolage
Nice to see brains in action.
I can see this for a "make your own bot" n? 5 ;)
why don't you move it there or make a ghost there.
kepp i'll explain some more.
take for example 789.35 GB total share.
when you do strlen(789.35) it's gone return the vallue 6, it checks how many characters a string/vallue has.
if the total share = 22278.46 GB it's gone return 8, in this case you can devide it again by 1024 to get the share in TB.
21.76 TB looks a lot better.
in words the code you need 2 write looks as the folowing.
1 calculate the share in GB.
2 check if the vallue is 6 characters or shorter.
3 send the data to the user in GB if 2 is true.
4 if the vallue is longer (2 if false) you need to devide by 1024 again and send that vallue to the user, showing this time it's TB.
5 buy yourself a beer, you done it.
plop
hmm, ok, So far i got this
tRL = strlen(22276.46)
That will give me the nr 8, nothing else
If i divide it with /1024
tRL = strlen(22276.46)/1024 <--- Returned 8
with one decimal
like this : 0.0078125
Which is false...
another thing i tried...
tRL = format("%0.2f", strlen(900.54))
ended up '6.00'
confused..
BETA!!! :D
-------------------
-- Info on connect
-- Made By Kepp
-- 03/10/30
-- Added: Botdecsription, such as speed, e-mail, connection
-- Idea from Mr420's botdesc script 01/11/03
-- Added: HubInfoAdvert, in main every hour
-------------------
hubadress = "your-hub.adress.here" --// :D
kb = 1024
mb = 1024/1024
Sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
sEC = 1000
MiN = 60*sEC ---// Don't touch any of this :P
Hour = 60*MiN
---------------
sU = "[SU]xxx"
sU1 = "[SU]xxx1" --//Your Super Operators name/s
sU2 = "[SU]xxx2"
sU3 = "[SU]xxx3"
---------------
sBot = "[Police]" --//Botname
eBot = "[E-mail]" --//The bots E-mail
BotS = "Faster Than Light" --//The bots speed :D
Botdesc = "El Jefe" --//Botdescription! El Jefe = The boss
botTag = "<--)V:0.999>"
---------------
SirYesSir = "Now Get Back To Work!"
opleave = "Where do you think you are going"
Gb = "Get Back Now!"
gSM = frmHub:GetMinShare()/(1024)
woo = format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024)
function Main()
SetTimer(Hour)
StartTimer()
frmHub:RegBot(sBot)
mIS = "$MyINFO $ALL "..sBot.." "..Botdesc.."$ $"..botTag.."$ $"..BotS..strchar( 1 ).."$"..eBot.."$"
SendToAll( mIS )
end
function NewUserConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("Welcome To: "..frmHub:GetHubName().."")
curUser:SendData("Your Name: "..curUser.sName)
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("Your Version: "..curUser.iVersion)
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("Total online users: "..frmHub:GetUsersCount().."")
curUser:SendData("Minimum Share for you: "..gSM.." GB")
curUser:SendData("Curent Share Amount: "..woo.." TB")
curUser:SendData("_____________________________________________")
end
function OpConnected(curUser)
curUser:SendData("_____________________________________________")
curUser:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
curUser:SendData("Your IP: "..curUser.sIP)
curUser:SendData("_____________________________________________")
SendToAll(sBot, "Hey "..curUser.sName..", "..SirYesSir)
end
function OpDisconnected(curUser)
SendToAll(sBot, opleave.." "..curUser.sName.." ? "..Gb)
end
function OnTimer()
SendToAll("Hub Name:")
SendToAll("\t\t\t\t\t["..frmHub:GetHubName().."]")
SendToAll("_____________________________________________")
SendToAll("Super Operators:")
SendToAll("["..sU.."]")
SendToAll("["..sU1.."]")
SendToAll("["..sU2.."]")
SendToAll("["..sU3.."]")
SendToAll("\t __________________________________________________________________")
SendToAll("\t\t Write /fav in main chat, And BOOM, our hub is in your Favorites")
SendToAll("\t __________________________________________________________________")
SendToAll("(`?._.?-=@ Remember : Enjoy your stay and let the DC sprit rule @=-?._.??)")
SendToAll("\t\t\t // Crew @ "..hubadress.."")
end
QuoteOriginally posted by kepp
another thing i tried...
tRL = format("%0.2f", strlen(900.54))
ended up '6.00'
confused..
ok next hint.
if strlen(share) <= 6 then
if this hits the spot your gone return the share in GB, if not you got some more deviding 2 do.
comeon i know you can do it.
if you continue like this your gone have a full opBot in a couple of weeks. lol
plop
tRL = format("%0.2f", strlen(1024.00)/1024)
^^ That will return 0.00..!!??
if i don't divide it it will return 4.00
so i assume i'll use:
format("%0.2f", strlen(1024.00)/1024)
so that will show the share in GB's from 0 up to
1024 Gb's !?
Ok i think i got it,
So the same thing now but this time with tb's?
format("%0.2f", strlen(30720.00)/1024)
OK.. now how would i do to make it change to TB
when it reaches 1 tb??
-------------------
-- Info on connect
-- Made By Kepp
-- 03/10/30
-- Added: Botdecsription, such as speed, e-mail, connection
-- Idea from Mr420's botdesc script 01/11/03
-- Added: HubInfoAdvert, in main every hour
-- Added: It will now show the curent user his/her DNS ;)
-------------------
hubadress = "your-hub.adress.here" --// :D
kb = 1024
mb = 1024/1024
Sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
sEC = 1000
MiN = 60*sEC ---// Don't touch any of this :P
Hour = 60*MiN
---------------
sU = "[SU]xxx"
sU1 = "[SU]xxx1" --//Your Super Operators name/s
sU2 = "[SU]xxx2"
sU3 = "[SU]xxx3"
---------------
sBot = "[Police]" --//Botname
eBot = "[E-mail]" --//The bots E-mail
BotS = "Faster Than Light" --//The bots speed :D
Botdesc = "El Jefe" --//Botdescription! El Jefe = The boss
botTag = "<--)V:0.999>"
---------------
SirYesSir = "Now Get Back To Work!"
opleave = "Where do you think you are going"
Gb = "Get Back Now!"
gSM = frmHub:GetMinShare()/(1024)
woo = format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024)
function Main()
SetTimer(Hour)
StartTimer()
frmHub:RegBot(sBot)
mIS = "$MyINFO $ALL "..sBot.." "..Botdesc.."$ $"..botTag.."$ $"..BotS..strchar( 1 ).."$"..eBot.."$"
SendToAll( mIS )
end
function NewUserConnected(curUser)
U = curUser
local h = tohostname(curUser.sIP)
U:SendData("_____________________________________________")
U:SendData("Welcome To: "..frmHub:GetHubName().."")
U:SendData("Your Name: "..curUser.sName)
U:SendData("Your IP: "..curUser.sIP.." \t Your DNS: "..tohostname(curUser.sIP))
U:SendData("Your Version: "..curUser.iVersion)
U:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
U:SendData("Total online users: "..frmHub:GetUsersCount().."")
U:SendData("Minimum Share for you: "..gSM.." GB")
U:SendData("Curent Share Amount: "..woo.." TB")
U:SendData("_____________________________________________")
end
function OpConnected(curUser)
U = curUser
local h = tohostname(curUser.sIP)
U:SendData("_____________________________________________")
U:SendData("Your Profile: "..(GetProfileName(curUser.iProfile) or "Unregistered"))
U:SendData("Your IP: "..curUser.sIP.." \t Your DNS: "..tohostname(curUser.sIP))
U:SendData("_____________________________________________")
SendToAll(sBot, "Hey "..curUser.sName..", "..SirYesSir)
end
function OpDisconnected(curUser)
SendToAll(sBot, opleave.." "..curUser.sName.." ? "..Gb)
end
function OnTimer()
SendToAll("Hub Name:")
SendToAll("\t\t\t\t\t["..frmHub:GetHubName().."]")
SendToAll("_____________________________________________")
SendToAll("Super Operators:")
SendToAll("["..sU.."]")
SendToAll("["..sU1.."]")
SendToAll("["..sU2.."]")
SendToAll("["..sU3.."]")
SendToAll("\t __________________________________________________________________")
SendToAll("\t\t Write /fav in main chat, And BOOM, our hub is in your Favorites")
SendToAll("\t __________________________________________________________________")
SendToAll("(`?._.?-=@ Remember : Enjoy your stay and let the DC sprit rule @=-?._.??)")
SendToAll("\t\t\t // Crew @ "..hubadress.."")
end
=)
Suggestions? :)
Plop, im still looking into the change of Gb's to tb's
can't figure it out... But just give me a few days... he he
-------------------// From this line please ;)
-- Info on connect v.0.2
-- Made By Kepp
-- 03/10/30
-- Added: Botdecsription, such as speed, e-mail, connection
-- Idea from Mr420's botdesc script 01/11/03
-- Added: HubInfoAdvert, in main every hour
-- Added: It will now show the curent user his/her DNS ;)
-- Added: Date And time on connect
-- Fixed: The list information about the user looks alot better now.
-- Added: Command ?author, the author of the script ;)
-- Added: Command ?myip, Will show the user his/her ip + DNS in PM
-- Added: Command !drop, Disconnect yourself
-- Fixed: All command now works in PM to the bot
--
-- Thanks Plop/Tezlo for helping me out
-------------------------------//For your own good
hubadress = "your-hub.adress.here" --// :D
country = "Sweden" --// Change this to your country
Network = "Network-adress.here"
-------------------------------// (Forgot)
kb = 1024
mb = 1024/1024
Sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
-------------------------------// Timer options
sEC = 1000
MiN = 60*sEC ---// Don't touch any of this :P
Hour = 60*MiN
------------------------------- // Op's/Su's name/s
sU = "[SU]xxx"
sU1 = "[SU]xxx1" --//Your Super Operators/Op's name/s
sU2 = "[SU]xxx2"
sU3 = "[SU]xxx3"
-------------------------------// Bot Options
sBot = "[Police]" --//Botname
eBot = "[E-mail]" --//The bots E-mail
BotS = "Faster Than Light" --//The bots speed :D
Botdesc = "El Jefe" --//Botdescription! El Jefe = The boss
botTag = "<--)V:0.999>"
-------------------------------// Ah-ah-ah
gSM = frmHub:GetMinShare()/(1024)
woo = format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024)
-------------------------------
function Main()
SetTimer(Hour)
StartTimer()
frmHub:RegBot(sBot)
mIS = "$MyINFO $ALL "..sBot.." "..Botdesc.."$ $"..botTag.."$ $"..BotS..strchar( 1 ).."$"..eBot.."$"
SendToAll( mIS )
end
-------------------------------// New user connected
function NewUserConnected(curUser)
U = curUser
local h = tohostname(curUser.sIP)
U:SendData("\t\t\t\t\t\t\t<============================================================>\t\t\t\t\t\t Welcome To\t\t:::\t"..frmHub:GetHubName().."\t\t\t\t\t\t\t Host is located in\t\t:::\t"..country.." \t\t\t\t\t\t\t\t Current Date And Time\t:::\t("..date()..") \t\t\t\t\t\t Your Name\t\t:::\t"..U.sName.."\t\t\t\t\t\t\t\t Your IP\t\t\t:::\t"..U.sIP.." \t\t\t\t\t\t\t Your DNS\t\t:::\t"..tohostname(U.sIP).." \t\t\t\t\t\t Your Version\t\t:::\t"..U.iVersion.."\t\t\t\t\t\t\t\t Your Profile\t\t:::\t"..(GetProfileName(U.iProfile) or "Unregistered) \t\t\t\t\t\t\t Total Online Users\t:::\t"..frmHub:GetUsersCount().." \t\t\t\t\t\t\t\t Minimum Share For You\t:::\t"..gSM.." \t\t\t\t\t\t\t\t Curent Share Amount\t:::\t"..woo.." TB\t\t\t\t\t\t\t<============================================================>"))
end
--------------------------------// Op connected
function OpConnected(curUser)
local h = tohostname(curUser.sIP)
U = curUser
U:SendData("\t\t\t\t\t\t<=======================================================>\t\t\t\t\t\tYour Profile\t::: \t"..(GetProfileName(U.iProfile).."\t\t\t\t\t\t\t\t\tYour IP\t\t:::\t"..U.sIP.."\t\t\t\t\t <=======================================================>"))
SendToAll(sBot, "Hey "..U.sName..", Now Get Back To Work!")
end
--------------------------------// An Op Disconnects
function OpDisconnected(curUser)
SendToAll(sBot, "Where do you think you are going "..curUser.sName.."? Get Back Now!")
end
--------------------------------// Timer function
function OnTimer()
SendToAll("<============"..frmHub:GetHubName().."============>Hub Owner: "..hubowner.." ==> Hub Address: "..hubadress.." ==> Op's: "..sU.." | "..sU1.." | "..sU2.." | "..sU3.." ==> Hub Network: "..Network.." ==>|")
end
--------------------------------// To this one =)
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="?author") then
user:SendPM(sBot, "Kepp is the author of this script")
end
end
return 1
end
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="?myip") then
user:SendPM(sBot, "Your IP: "..user.sIP.." From "..tohostname(user.sIP))
end
end
return 1
end
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!drop") then
user:Disconnect()
end
end
return 1
end
its all great but..
you can only have ONE DataArrival
you should calc total share amount everytime a user connects.. not on script start
Error:
BotS = "LAN(ThC)" --//The bots speed :D
Botdesc = "<++ V:0.301,M:P,H:0/0/1,S:5>" --//Botdescription! El Jefe = The boss
botTag = "<++ V:0.301,M:P,H:0/0/1,S:5>"
with these settings the bot have:
Connection: <++ V:0.301,M:P,H:0/0/1,S:5
Description: <++ V:0.301,M:P,H:0/0/1,S:5>
Tag:
(sorry for my bad english)
Bye
kepp try writing in this style, makes if a lot easyer 2 read.
--------------------------------// To this one =)
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="?author") then
user:SendPM(sBot, "Kepp is the author of this script")
end
end
return 1
end
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="?myip") then
user:SendPM(sBot, "Your IP: "..user.sIP.." From "..tohostname(user.sIP))
end
end
return 1
end
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!drop") then
user:Disconnect()
end
end
return 1
end
with elseif you can make those 3 into 1 so they all work and not only the 1st.
if you look closely you can allready see how 2 do this.
plop
how's it going kepp??
plop
Internet has been down for a couple of days, but back up now :)
Yea, i noticed when i checked it out right after the shutdown of my internet, i can olny use one of the commands, reading the manual about Else if now :)
or shall i say elseif? :D
Hi there,,
kepp,,
As tezlo said,... better use 1 function data arrival :)
So,, use 'elseif' in your commands choice,, yep,... smthg like that should work fine:
-------
--------------------------------// To this one =)
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="?author") then
user:SendPM(sBot, "Kepp is the author of this script")
elseif (cmd=="?myip") then
user:SendPM(sBot, "Your IP: "..user.sIP.." From "..tohostname(user.sIP))
elseif (cmd=="!drop") then
user:Disconnect()
end
end
return 1
end
-------
Btw,, your:
----
elseif (cmd=="!drop") then
user:Disconnect()
----
should be quite funny to use,.... lol
Good luck,,
l8tr,, ;)
QuoteOriginally posted by Guibs
Hi there,,
kepp,,
As tezlo said,... better use 1 function data arrival :)
So,, use 'elseif' in your commands choice,, yep,... smthg like that should work fine:
-------
--------------------------------// To this one =)
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="?author") then
user:SendPM(sBot, "Kepp is the author of this script")
elseif (cmd=="?myip") then
user:SendPM(sBot, "Your IP: "..user.sIP.." From "..tohostname(user.sIP))
elseif (cmd=="!drop") then
user:Disconnect()
end
end
return 1
end
-------
Btw,, your:
----
elseif (cmd=="!drop") then
user:Disconnect()
----
should be quite funny to use,.... lol
Good luck,,
l8tr,, ;)
elseif (cmd=="!drop") then
user:Disconnect()
hmm now why wud you want to drop yourself :P
:D
Ah well, it should be the victim :P
-------------------// From this line please ;)
-- Info on connect v.0.3
-- Made By Kepp
-- 03/10/30
-- Added: Botdecsription, such as speed, e-mail, connection
-- Idea from Mr420's botdesc script 01/11/03
-- Added: HubInfoAdvert, in main every hour
-- Added: It will now show the curent user his/her DNS ;)
-- Added: Date And time on connect
-- Fixed: The list information about the user looks alot better now.
-- Added: Command !author, the author of the script ;)
-- Added: Command !myip, Will show the user his/her ip + DNS in PM
-- Added: Command !drop, Disconnect yourself
-- Fixed: All command now works in PM to the bot
-- Added: Command !getip , Will show you the user's IP and DNS server
--
-- Thanks Plop/Tezlo for helping me out
-------------------------------//For your own good
hubadress = "your-hub.adress.here" --// :D
country = "Sweden" --// Change this to your country
Network = "Network-adress.here"
-------------------------------// (Forgot)
kb = 1024
mb = 1024/1024
Sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
-------------------------------// Timer options
sEC = 1000
MiN = 60*sEC ---// Don't touch any of this :P
Hour = 60*MiN
------------------------------- // Op's/Su's name/s
sU = "[SU]xxx"
sU1 = "[SU]xxx1" --//Your Super Operators/Op's name/s
sU2 = "[SU]xxx2"
sU3 = "[SU]xxx3"
-------------------------------// Bot Options
sBot = "[Police]" --//Botname
eBot = "[E-mail]" --//The bots E-mail
BotS = "Faster Than Light" --//The bots speed :D
Botdesc = "El Jefe" --//Botdescription! El Jefe = The boss
botTag = "<--)V:0.999>"
-------------------------------// Ah-ah-ah
gSM = frmHub:GetMinShare()/(1024)
woo = format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024)
-------------------------------
function Main()
SetTimer(Hour)
StartTimer()
frmHub:RegBot(sBot)
mIS = "$MyINFO $ALL "..sBot.." "..Botdesc.."$ $"..botTag.."$ $"..BotS..strchar( 1 ).."$"..eBot.."$"
SendToAll( mIS )
end
-------------------------------// New user connected
function NewUserConnected(curUser)
U = curUser
local h = tohostname(curUser.sIP)
U:SendData("\t\t\t\t\t\t\t<============================================================>\t\t\t\t\t\t Welcome To\t\t:::\t"..frmHub:GetHubName().."\t\t\t\t\t\t\t Host is located in\t\t:::\t"..country.." \t\t\t\t\t\t\t\t Current Date And Time\t:::\t("..date()..") \t\t\t\t\t\t Your Name\t\t:::\t"..U.sName.."\t\t\t\t\t\t\t\t Your IP\t\t\t:::\t"..U.sIP.." \t\t\t\t\t\t\t Your DNS\t\t:::\t"..tohostname(U.sIP).." \t\t\t\t\t\t Your Version\t\t:::\t"..U.iVersion.."\t\t\t\t\t\t\t\t Your Profile\t\t:::\t"..(GetProfileName(U.iProfile) or "Unregistered) \t\t\t\t\t\t\t Total Online Users\t:::\t"..frmHub:GetUsersCount().." \t\t\t\t\t\t\t\t Minimum Share For You\t:::\t"..gSM.." \t\t\t\t\t\t\t\t Curent Share Amount\t:::\t"..woo.." TB\t\t\t\t\t\t\t<============================================================>"))
end
--------------------------------// Op connected
function OpConnected(curUser)
local h = tohostname(curUser.sIP)
U = curUser
U:SendData("\t\t\t\t\t\t<=======================================================>\t\t\t\t\t\tYour Profile\t::: \t"..(GetProfileName(U.iProfile).."\t\t\t\t\t\t\t\t\tYour IP\t\t:::\t"..U.sIP.."\t\t\t\t\t <=======================================================>"))
SendToAll(sBot, "Hey "..U.sName..", Now Get Back To Work!")
end
--------------------------------// An Op Disconnects
function OpDisconnected(curUser)
SendToAll(sBot, "Where do you think you are going "..curUser.sName.."? Get Back Now!")
end
--------------------------------// Timer function
function OnTimer()
SendToAll("<============"..frmHub:GetHubName().."============>Hub Owner: "..hubowner.." ==> Hub Address: "..hubadress.." ==> Op's: "..sU.." | "..sU1.." | "..sU2.." | "..sU3.." ==> Hub Network: "..Network.." ==>|")
end
--------------------------------// To this one =)
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!author") then
user:SendData(sBot, "Kepp is the author of this script") return 1
elseif (cmd=="!drop") then
user:Disconnect()
elseif (cmd=="!myip") then
user:SendPM(sBot, "Your IP: "..user.sIP.." From "..tohostname(user.sIP)) return 1
elseif (cmd=="!getip") then
s,e,cmd,Name = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
victim = GetItemByName(Name)
if victim == nil then
user:SendData("**** User is not in the list.") return 1 end
if not user.bOperator then
user:SendData("**** You are not allowed to use this function") return 1
else
user:SendPM(sBot, victim.sName.."'s IP is: "..victim.sIP.." \t\t:::\tDNS: "..tohostname(victim.sIP)) return 1
end
end
end
end
I kept the drop command, may be useful for some...
Added another command, !getip
but still working on a when you're logging in as a normal user and type that command without user...
:)
more to come
-------------------// From this line please ;)
-- Info on connect v.0.4
-- Made By Kepp
-- 03/10/30
-- Added: Botdecsription, such as speed, e-mail, connection
-- Idea from Mr420's botdesc script 01/11/03
-- Added: HubInfoAdvert, in main every hour
-- Added: It will now show the curent user his/her DNS ;)
-- Added: Date And time on connect
-- Fixed: The list information about the user looks alot better now.
-- Added: Command !author, the author of the script ;)
-- Added: Command !myip, Will show the user his/her ip + DNS in PM
-- Added: Command !drop, Disconnect yourself
-- Fixed: All command now works in PM to the bot
-- Added: Command !getip , Will show you the user's IP and DNS server
-- Fixed: A bug, Report from Darkelf
-- Added: Gave the bot a share of 43.38 GB ;)
--
-- Thanks Plop/Tezlo for helping me out
-------------------------------//For your own good
hubadress = "your-hub.adress.here" --// :D
country = "Sweden"
Network = "Network-adress.here"
-------------------------------// (Forgot)
kb = 1024
mb = 1024/1024
Sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
-------------------------------// Timer options
sEC = 1000
MiN = 60*sEC ---// Don't touch any of this :P
Hour = 60*MiN
------------------------------- // Op's/Su's name/s
HuBowner = "XXX" --// Hubowners name here
sU = "[SU]xxx"
sU1 = "[SU]xxx1" --//Your Super Operators/Op's name/s
sU2 = "[SU]xxx2"
sU3 = "[SU]xxx3"
-------------------------------// Bot Options
sBot = "[Police]" --//Botname
eBot = "[E-mail]" --//The bots E-mail
BotS = "Faster Than Light" --//The bots speed :D
Botdesc = "El Jefe" --//Botdescription! El Jefe = The boss
botTag = "<--)V:0.4>"
botS = 46582578356
-------------------------------// Ah-ah-ah
function Main()
SetTimer(Hour)
StartTimer()
frmHub:RegBot(sBot)
frmHub:EnableFullData(1)
mIS= "$MyINFO $ALL "..sBot.." "..Botdesc.." "..botTag.."$ $"..BotS..strchar( 1 ).."$"..eBot.."$"..botS.."$"
SendToAll( mIS )
end
-------------------------------// New user connected
function NewUserConnected(curUser)
local host = tohostname(curUser.sIP)
U = curUser
U:SendData("<============================================================>")
U:SendData("Welcome To\t\t:\t"..frmHub:GetHubName())
U:SendData("Current data and time\t\t:\t"..date())
U:SendData("Your Name\t\t\t:\t"..curUser.sName)
U:SendData("Your IP\t\t\t:\t"..curUser.sIP)
U:SendData("Your DNS\t\t\t:\t"..tohostname(curUser.sIP))
U:SendData("Total Online Users\t\t:\t"..frmHub:GetUsersCount())
U:SendData("Minimum Share For You\t:\t"..frmHub:GetMinShare()/(1024).." GB")
U:SendData("Current Share Ammount\t:\t"..format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024).." TB")
U:SendData("<============================================================>")
end
--------------------------------// Op connected
function OpConnected(curUser)
local h = tohostname(curUser.sIP)
U = curUser
U:SendData("<=======================================================>")
U:SendData("Your Profile\t:\t"..(GetProfileName(U.iProfile) or unregistered))
U:SendData("Your IP\t:\t"..U.sIP)
U:SendData("<=======================================================>")
SendToAll(sBot, "Hey "..U.sName..", Now Get Back To Work!")
end
--------------------------------// An Op Disconnects
function OpDisconnected(curUser)
SendToAll(sBot, "Where do you think you are going "..curUser.sName.."? Get Back Now!")
end
--------------------------------// Timer function
function OnTimer()
SendToAll("<============"..frmHub:GetHubName().."============>")
SendToAll("\tHub Owner: "..HuBowner)
SendToAll("\tHub Adress: "..hubadress)
SendToAll("\tOp's: | "..sU.." | "..sU1.." | "..sU2.." | "..sU3)
SendToAll("\tHub Network: "..Network)
end
--------------------------------// To this one =)
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!author") then
user:SendData(sBot, "Kepp is the author of this script") return 1
elseif (cmd=="!drop") then
user:Disconnect() return 1
elseif (cmd=="!myip") then
user:SendPM(sBot, "Your IP: "..user.sIP.." From "..tohostname(user.sIP)) return 1
elseif (cmd=="!getip") then
s,e,cmd,Name = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
victim = GetItemByName(Name)
if user.bOperator then
user:SendPM(sBot, victim.sName.."'s IP is: "..victim.sIP.." \t\t:::\tDNS: "..tohostname(victim.sIP))return 1
end
end
end
end
did some minor cleaning up.
now everything is in tabbed style (send me an email and i'll send you a nice lua editor).
-------------------// From this line please ;)
-- Info on connect v.0.4
-- Made By Kepp
-- 03/10/30
-- Added: Botdecsription, such as speed, e-mail, connection
-- Idea from Mr420's botdesc script 01/11/03
-- Added: HubInfoAdvert, in main every hour
-- Added: It will now show the curent user his/her DNS ;)
-- Added: Date And time on connect
-- Fixed: The list information about the user looks alot better now.
-- Added: Command !author, the author of the script ;)
-- Added: Command !myip, Will show the user his/her ip + DNS in PM
-- Added: Command !drop, Disconnect yourself
-- Fixed: All command now works in PM to the bot
-- Added: Command !getip , Will show you the user's IP and DNS server
-- Fixed: A bug, Report from Darkelf
-- Added: Gave the bot a share of 43.38 GB ;)
--
-- Thanks Plop/Tezlo for helping me out
-------------------------------//For your own good
hubadress = "your-hub.adress.here" --// :D
country = "Sweden"
Network = "Network-adress.here"
-------------------------------// (Forgot)
kb = 1024
mb = 1024/1024
Sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
-------------------------------// Timer options
sEC = 1000
MiN = 60*sEC ---// Don't touch any of this :P
Hour = 60*MiN
------------------------------- // Op's/Su's name/s
HuBowner = "XXX" --// Hubowners name here
sU = "[SU]xxx"
sU1 = "[SU]xxx1" --//Your Super Operators/Op's name/s
sU2 = "[SU]xxx2"
sU3 = "[SU]xxx3"
-------------------------------// Bot Options
sBot = "[Police]" --//Botname
eBot = "[E-mail]" --//The bots E-mail
BotS = "Faster Than Light" --//The bots speed :D
Botdesc = "El Jefe" --//Botdescription! El Jefe = The boss
botTag = "<--)V:0.4>"
botS = 46582578356
mIS= "$MyINFO $ALL "..sBot.." "..Botdesc.." "..botTag.."$ $"..BotS..strchar( 1 ).."$"..eBot.."$"..botS.."$"
-------------------------------// Ah-ah-ah
function Main()
SetTimer(Hour)
StartTimer()
frmHub:RegBot(sBot)
frmHub:EnableFullData(1)
SendToAll( mIS )
end
-------------------------------// New user connected
function NewUserConnected(user)
local host = tohostname(user.sIP)
user:SendData("<============================================================>")
user:SendData("Welcome To\t\t:\t"..frmHub:GetHubName())
user:SendData("Current data and time\t\t:\t"..date())
user:SendData("Your Name\t\t\t:\t"..user.sName)
user:SendData("Your IP\t\t\t:\t"..user.sIP)
user:SendData("Your DNS\t\t\t:\t"..tohostname(user.sIP))
user:SendData("Total Online Users\t\t:\t"..frmHub:GetUsersCount())
user:SendData("Minimum Share For You\t:\t"..frmHub:GetMinShare()/(1024).." GB")
user:SendData("Current Share Ammount\t:\t"..format("%0.2f", frmHub:GetCurrentShareAmount()/1024/1024/1024/1024).." TB")
user:SendData("<============================================================>")
end
--------------------------------// Op connected
function OpConnected(user)
local h = tohostname(user.sIP)
user:SendData("<=======================================================>")
user:SendData("Your Profile\t:\t"..(GetProfileName(user.iProfile) or unregistered))
user:SendData("Your IP\t:\t"..user.sIP)
user:SendData("<=======================================================>")
SendToAll(sBot, "Hey "..user.sName..", Now Get Back To Work!")
end
--------------------------------// An Op Disconnects
function OpDisconnected(user)
SendToAll(sBot, "Where do you think you are going "..user.sName.."? Get Back Now!")
end
--------------------------------// Timer function
function OnTimer()
SendToAll("<============"..frmHub:GetHubName().."============>")
SendToAll("\tHub Owner: "..HuBowner)
SendToAll("\tHub Adress: "..hubadress)
SendToAll("\tOp's: | "..sU.." | "..sU1.." | "..sU2.." | "..sU3)
SendToAll("\tHub Network: "..Network)
end
--------------------------------// To this one =)
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!author") then
user:SendData(sBot, "Kepp is the author of this script") return 1
elseif (cmd=="!drop") then
user:Disconnect() return 1
elseif (cmd=="!myip") then
user:SendPM(sBot, "Your IP: "..user.sIP.." From "..tohostname(user.sIP)) return 1
elseif (cmd=="!getip") then
s,e,cmd,Name = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
victim = GetItemByName(Name)
if user.bOperator then
user:SendPM(sBot, victim.sName.."'s IP is: "..victim.sIP.." \t\t:::\tDNS: "..tohostname(victim.sIP))return 1
end
end
end
end
before you start trying tables i sugest you take a look here (http://board.univ-angers.fr/thread.php?threadid=490&boardid=13&sid=e7fdc459eb111f889ad6501ee8eb4c33).
that can help you making it look a bit nicer.
and then you can use the next 2 do the share size i sugested by using this piece of code.
local tempshare = format("%0.2f", (frmHub:GetCurrentShareAmount()/1024/1024/1024))
if strlen(tempshare) <= 6 then
tempshare = tempshare.." GB"
else
tempshare = format("%0.2f", (tempshare/1024)).." TB"
end
when your done with that whill start with using a table for the op's and extracting them from the registered users file from ptokax.
this because it's easyer if you use that fancy way.
good luck
plop
-------------------// From this line please ;)
-- Info on connect v.0.4
-- Made By Kepp
-- 03/10/30
-- Added: Botdecsription, such as speed, e-mail, connection
-- Idea from Mr420's botdesc script 01/11/03
-- Added: HubInfoAdvert, in main every hour
-- Added: It will now show the curent user his/her DNS ;)
-- Added: Date And time on connect
-- Fixed: The list information about the user looks alot better now.
-- Added: Command !author, the author of the script ;)
-- Added: Command !myip, Will show the user his/her ip + DNS in PM
-- Added: Command !drop, Disconnect yourself
-- Fixed: All command now works in PM to the bot
-- Added: Command !getip , Will show you the user's IP and DNS server
-- Fixed: A bug, Report from Darkelf
-- Added: Gave the bot a share of 43.38 GB ;)
--
-- Thanks Plop/Tezlo for helping me out
-------------------------------//For your own good
hubadress = "your-hub.adress.here" --// :D
country = "Sweden"
Network = "Network-adress.here"
-------------------------------// (Forgot)
kb = 1024
mb = 1024/1024
Sgb = 1024/1024/1024
tb = 1024/1024/1024/1024
-------------------------------// Timer options
sEC = 1000
MiN = 60*sEC ---// Don't touch any of this :P
Hour = 60*MiN
------------------------------- // Op's/Su's name/s
HuBowner = "XXX" --// Hubowners name here
sU = "[SU]xxx"
sU1 = "[SU]xxx1" --//Your Super Operators/Op's name/s
sU2 = "[SU]xxx2"
sU3 = "[SU]xxx3"
-------------------------------// Bot Options
sBot = "[Police]" --//Botname
eBot = "[E-mail]" --//The bots E-mail
BotS = "Faster Than Light" --//The bots speed :D
Botdesc = "El Jefe" --//Botdescription! El Jefe = The boss
botTag = "<--)V:0.4>"
botS = 46582578356
mIS= "$MyINFO $ALL "..sBot.." "..Botdesc.." "..botTag.."$ $"..BotS..strchar( 1 ).."$"..eBot.."$"..botS.."$"
-------------------------------// Ah-ah-ah
function Main()
SetTimer(Hour)
StartTimer()
frmHub:RegBot(sBot)
frmHub:EnableFullData(1)
SendToAll( mIS )
end
-------------------------------// New user connected
function NewUserConnected(user)
local share = format("%0.2f",(frmHub:GetCurrentShareAmount()/1024/1024/1024))
if strlen(share) <= 6 then
share = share.." GB"
else
share = format("%0.2f", (share/1024)).." TB"
end
local host = tohostname(user.sIP)
user:SendData("<============================================================>")
user:SendData("Welcome To\t\t:\t"..frmHub:GetHubName())
user:SendData("Current data and time\t\t:\t"..date())
user:SendData("Your Name\t\t\t:\t"..user.sName)
user:SendData("Your IP\t\t\t:\t"..user.sIP)
user:SendData("Your DNS\t\t\t:\t"..tohostname(user.sIP))
user:SendData("Total Online Users\t\t:\t"..frmHub:GetUsersCount())
user:SendData("Minimum Share For You\t:\t"..frmHub:GetMinShare()/(1024).." GB")
user:SendData("Current Share Amount: "..share)
user:SendData("<============================================================>")
end
--------------------------------// Op connected
function OpConnected(user)
local h = tohostname(user.sIP)
user:SendData("<=======================================================>")
user:SendData("Your Profile\t:\t"..(GetProfileName(user.iProfile) or unregistered))
user:SendData("Your IP\t:\t"..user.sIP)
user:SendData("<=======================================================>")
SendToAll(sBot, "Hey "..user.sName..", Now Get Back To Work!")
end
--------------------------------// An Op Disconnects
function OpDisconnected(user)
SendToAll(sBot, "Where do you think you are going "..user.sName.."? Get Back Now!")
end
--------------------------------// Timer function
function OnTimer()
SendToAll("<============"..frmHub:GetHubName().."============>")
SendToAll("\tHub Owner: "..HuBowner)
SendToAll("\tHub Adress: "..hubadress)
SendToAll("\tOp's: | "..sU.." | "..sU1.." | "..sU2.." | "..sU3)
SendToAll("\tHub Network: "..Network)
end
--------------------------------// To this one =)
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!author") then
user:SendData(sBot, "Kepp is the author of this script") return 1
elseif (cmd=="!drop") then
user:Disconnect() return 1
elseif (cmd=="!myip") then
user:SendPM(sBot, "Your IP: "..user.sIP.." From "..tohostname(user.sIP)) return 1
elseif (cmd=="!getip") then
s,e,cmd,Name = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
victim = GetItemByName(Name)
if user.bOperator then
user:SendPM(sBot, victim.sName.."'s IP is: "..victim.sIP.." \t\t:::\tDNS: "..tohostname(victim.sIP))return 1
end
end
end
end
If i understood this right
local tempshare = format("%0.2f", (frmHub:GetCurrentShareAmount()/1024/1024/1024))
if strlen(tempshare) <= 6 then
tempshare = tempshare.." GB"
else
tempshare = format("%0.2f", (tempshare/1024)).." TB"
end
It will get the current share amount in GB
if strlen finds 6 characters in tempshare then
Tempshare will show the amount in GB
else (If it finds more than 6 it will display it in TB)
He he, not really here i wanted you to go comment my misstakes... Im sending you an E-Mail now..
Tack Care
-----------------------------------------------------------#
-----------------------------------------------------------#
--# [P0lic?] Made By Kepp v.0.5
--# Added: Botdecsription, such as speed, e-mail, connection
--# Added: Date And time on connect
--# Added: Command +shoot, shoot a user
--# Fixed: All command now works in PM to the bot
--# Fixed: Rewrote everything 2003/18/11
--# Thanks Plop/Tezlo for helping me out
--#
-----------------------------------------------------------#
-----------------------------------------------------------#
sec = 1000
min = 60*sec
hour = 60*min
-----------------------------------------------------------------------------------------------------
Bot = "[P0lic?]"
Bote = "comment@hotmail.com"
Bots = "Faster Than Light"
Botdesc = "El Jefe"
Bottag = "<--)V:0.4>"
My_Info = "$MyINFO $ALL "..Bot.." "..Botdesc.." "..Bottag.."$ $"..Bots..strchar( 1 ).."$"..Bote.."$"
------------------------------------------------------------------------------------------------------
HubAdress = "theabyss2.no-ip.org"
Country = "Sweden"
NetWork = "The Abyss Network"
------------------------------------------------------------------------------------------------------
Ops = {}
function Main()
frmHub:RegBot(Bot)
frmHub:EnableFullData(1)
SetTimer(hour)
StartTimer()
SendToAll(My_Info)
end
-----------------------------------------------------------------------------------------------------
function NewUserConnected(curUser)
local share = format("%0.2f",(frmHub:GetCurrentShareAmount()/1024/1024/1024))
if strlen(share) <= 6 then
share = share.." GB"
else
share = format("%0.2f", (share/1024)).." TB"
end
curUser:SendData("<=========================-["..frmHub:GetHubName().."]-=========================>")
curUser:SendData("Your Name\t\t:::\t"..curUser.sName)
curUser:SendData("Your IP\t\t:::\t"..curUser.sIP)
curUser:SendData("Your DNS\t\t:::\t"..tohostname(curUser.sIP) or "N/A")
curUser:SendData("Min Share\t\t:::\t"..frmHub:GetMinShare()/(1024).." GB")
curUser:SendData("Online Users\t:::\t"..frmHub:GetUsersCount())
curUser:SendData("Current Share\t:::\t"..share)
curUser:SendData("Op's Online\t\t:::\t"..getn(Ops))
curUser:SendData("Current Date\t:::\t"..date("%Y/%B/%A").." Time is: "..date("%H:%M"))
end
-------------------------------------------------------------------------------------------------------
function OpConnected(user)
tinsert(Ops, user.sName)
user:SendData("<=========================-["..user.sName.."]-=========================>")
user:SendData("Your Profile ::: "..GetProfileName(user.iProfile))
user:SendData("Your IP ::: "..user.sIP)
user:SendData("Type +help in main to get your commands.")
SendToAll(Bot, "Hey "..user.sName.." Now get back to work")
end
-------------------------------------------------------------------------------------------------------
function OpDisconnected(user)
SendToAll(Bot, "Where do you think you are going "..user.sName.."? Get Back Now!")
end
function DataArrival(user, data)
if strsub(data, 1 , 1) == "<" or strsub(data, 1, 4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="+shoot") and user.iProfile == 0 or user.iProfile == 1 then
s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
victim = GetItemByName(arg)
if victim ~= nil then
if victim.bOperator then
user:SendData("***You can't shoot That user, He/She is hiding!") return 1
else
SendToAll(Bot, ""..user.sName.." Shot "..victim.sName.." In the head!")
victim:SendPM(Bot, ""..user.sName.." Just shot you in the head! (Which means, You are dead..)")
victim:Disconnect() return 1 end
else
user:SendData("***You must enter a name") return 1 end
end
end
end
function OnTimer()
SendToAll("<================================================================>")
SendToAll("\tHub-Address\t\t:::\t"..HubAdress)
SendToAll("\tCountry\t\t\t:::\t"..Country)
SendToAll("\tOur Network\t\t:::\t"..NetWork)
SendToAll("\tCurrent Date\t\t:::\t"..date("%Y/%B/%A").." Time is: "..date("%X"))
SendToAll("<================================================================>")
end
Update
I think i should mention that i get a Syntax Error
Syntax Error: attempt to concat a nil value
Now, i can't find where it comes from...:S
Otherwise, everything is OK