hello everyone good evening there
well mates i have a script that i m useing in the old version of ptoka x
and i wanna change it to work in Lua 5
here is the script :
--// Random Intros and Outros
--// By Chaggydawg
--// Does it work?? Who knows these things??
--// Revision 0.2
HubOwner = "LiqUiD~TrolL"
intros = {
"[USERNAME] Crawls In On Their Hands And Knees.",
"In A Fiery Explosion [USERNAME] Appears.",
"With A Crazed Look In Their Eyes [USERNAME] Arrives.",
"Sir [USERNAME] Of The East Lunatic Fringe Has Arrived.",
"[USERNAME] Arrives Yelling And Screaming Like A Maniac.",
"[USERNAME] Arrives Ranting And Raving About Aliens Or Some Such Rot.",
"The Demented [USERNAME] Has Arrived.",
"[USERNAME] Appears Out Of Nowhere And Begins Speaking In Tongues.",
"[USERNAME] Arrives And Immediately Heads For The Light Like A Moth.",
"[USERNAME] Climbs In Through The Window With A Big Joint.",
"[USERNAME] Falls From The Skylight And Lands On A Mushroom.",
"[USERNAME] Enters the Room With A Bottle Of L.S.D On His Hands.",
"After Alot Of Loud Groaning [USERNAME] Comes Waltzing Out Of Janines Room...",
"Hair In Everywhich Direction [USERNAME] Arrives On The Scene Looking More Crazed Than Usual.",
"Brandishing What Looks Like A Hairbrush [USERNAME] Arrives.",
"[USERNAME] Arrives An ElfGirl Under Each Arm",
"[USERNAME] Appears Out Of Thin Air Scaring The Hell Out Of Janine.",
"[USERNAME] Parachutes In From An Airplane.",
"[USERNAME] Runs In, Stubs Their Toe On A Couch And Falls Over A Table Landing On Janine.",
"[USERNAME] Crashes Through The East Wall Arriving In The Hub.",
"[USERNAME] is here, How about a round of elfgirls for everyone?",
}
outros = {
"[USERNAME] Has Left The Hub",
"Jumping Through A Plate-Glass Window [USERNAME] Leaves The Hub With His SnowBoard.",
"Aliens Rocks Abduct [USERNAME], And They Are Gone.",
"[USERNAME] Begins Shrinking, And Eventually Disappears From The Hub.",
"Janine Takes [USERNAME] By The Arm And Leads Them To Her Room Closing The Door.",
"With Cat Like Reflexes [USERNAME] Leaps Out The Window And Is Gone.",
"The Lights Momentarily Dim, And When They Come Back On [USERNAME] Is Gone.",
"Three Giant Men In White Coats March In And Haul Away [USERNAME] Kicking and Screaming.",
"[USERNAME] Leaves Through The Basement Door",
"[USERNAME] Accidentally Walks Into Janines Room, Muffled Screams Are Heard For A Few Seconds But [USERNAME] Is Gone.",
"Suddenly [USERNAME] Leaps Up And Bolts For The Door.",
"[USERNAME] Tosses A Ten On Janine Dresser And Walks Out The Door.",
"[USERNAME] Runs Around The Room Screaming & Laughing *ACID.ACID.ACID*.",
}
--// This function is fired when an operator enters the hub
function OpConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if GetProfileName(curUser.iProfile) == "Master" then LevelBot = "Administrator" end
if curUser.sName == HubOwner then LevelBot = "Hub Owner" end
intro, x = gsub(intros[random(1,getn(intros))], "%b[]", curUser.sName)
SendToAll(LevelBot, intro)
end
--// This function is fired when an operator disconnects
function OpDisconnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if GetProfileName(curUser.iProfile) == "Master" then LevelBot = "Administrator" end
if curUser.sName == HubOwner then LevelBot = "Hub Owner" end
outro, x = gsub(outros[random(1,getn(outros))], "%b[]", curUser.sName)
SendToAll(LevelBot, outro)
end
--// This function is fired when a new user finishes the login
function NewUserConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
intro, x = gsub(intros[random(1,getn(intros))], "%b[]", curUser.sName)
SendToAll(LevelBot, intro)
else
end
end
--// This function is fired when an user disconnects
function UserDisconnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
outro, x = gsub(outros[random(1,getn(outros))], "%b[]", curUser.sName)
SendToAll(LevelBot, outro)
else
end
end
======================================
tnx for atteniton i hope it s easy to fix it for all crazy scripters.!!
=)
Try this:
--// Random Intros and Outros
--// By Chaggydawg
--// Does it work?? Who knows these things??
--// Revision 0.2
HubOwner = "LiqUiD~TrolL"
intros = {
"[USERNAME] Crawls In On Their Hands And Knees.",
"In A Fiery Explosion [USERNAME] Appears.",
"With A Crazed Look In Their Eyes [USERNAME] Arrives.",
"Sir [USERNAME] Of The East Lunatic Fringe Has Arrived.",
"[USERNAME] Arrives Yelling And Screaming Like A Maniac.",
"[USERNAME] Arrives Ranting And Raving About Aliens Or Some Such Rot.",
"The Demented [USERNAME] Has Arrived.",
"[USERNAME] Appears Out Of Nowhere And Begins Speaking In Tongues.",
"[USERNAME] Arrives And Immediately Heads For The Light Like A Moth.",
"[USERNAME] Climbs In Through The Window With A Big Joint.",
"[USERNAME] Falls From The Skylight And Lands On A Mushroom.",
"[USERNAME] Enters the Room With A Bottle Of L.S.D On His Hands.",
"After Alot Of Loud Groaning [USERNAME] Comes Waltzing Out Of Janines Room...",
"Hair In Everywhich Direction [USERNAME] Arrives On The Scene Looking More Crazed Than Usual.",
"Brandishing What Looks Like A Hairbrush [USERNAME] Arrives.",
"[USERNAME] Arrives An ElfGirl Under Each Arm",
"[USERNAME] Appears Out Of Thin Air Scaring The Hell Out Of Janine.",
"[USERNAME] Parachutes In From An Airplane.",
"[USERNAME] Runs In, Stubs Their Toe On A Couch And Falls Over A Table Landing On Janine.",
"[USERNAME] Crashes Through The East Wall Arriving In The Hub.",
"[USERNAME] is here, How about a round of elfgirls for everyone?",
}
outros = {
"[USERNAME] Has Left The Hub",
"Jumping Through A Plate-Glass Window [USERNAME] Leaves The Hub With His SnowBoard.",
"Aliens Rocks Abduct [USERNAME], And They Are Gone.",
"[USERNAME] Begins Shrinking, And Eventually Disappears From The Hub.",
"Janine Takes [USERNAME] By The Arm And Leads Them To Her Room Closing The Door.",
"With Cat Like Reflexes [USERNAME] Leaps Out The Window And Is Gone.",
"The Lights Momentarily Dim, And When They Come Back On [USERNAME] Is Gone.",
"Three Giant Men In White Coats March In And Haul Away [USERNAME] Kicking and Screaming.",
"[USERNAME] Leaves Through The Basement Door",
"[USERNAME] Accidentally Walks Into Janines Room, Muffled Screams Are Heard For A Few Seconds But [USERNAME] Is Gone.",
"Suddenly [USERNAME] Leaps Up And Bolts For The Door.",
"[USERNAME] Tosses A Ten On Janine Dresser And Walks Out The Door.",
"[USERNAME] Runs Around The Room Screaming & Laughing *ACID.ACID.ACID*.",
}
--// This function is fired when an operator enters the hub
function OpConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if GetProfileName(curUser.iProfile) == "Master" then LevelBot = "Administrator" end
if curUser.sName == HubOwner then LevelBot = "Hub Owner" end
intro, x = string.gsub(intros[math.random(1,table.getn(intros))], "%b[]", curUser.sName)
SendToAll(LevelBot, intro)
end
--// This function is fired when an operator disconnects
function OpDisconnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if GetProfileName(curUser.iProfile) == "Master" then LevelBot = "Administrator" end
if curUser.sName == HubOwner then LevelBot = "Hub Owner" end
outro, x = string.gsub(outros[math.random(1,table.getn(outros))], "%b[]", curUser.sName)
SendToAll(LevelBot, outro)
end
--// This function is fired when a new user finishes the login
function NewUserConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
intro, x = string.gsub(intros[math.random(1,table.getn(intros))], "%b[]", curUser.sName)
SendToAll(LevelBot, intro)
else
end
end
--// This function is fired when an user disconnects
function UserDisconnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
outro, x = string.gsub(outros[math.random(1,table.getn(outros))], "%b[]", curUser.sName)
SendToAll(LevelBot, outro)
else
end
end
Best regards,
jiten
ok my saveour the scrit worked,but i can t understood how you fix it
i ve noticed both of the scripts and i didn t find any diffrence,i guess the diffrence is somewhere but where
ahahahahah
it wil be great if you can tel me your secret,cuase i don t want to bother ppl all the time ,i prefer to fix it by my own
and by the way here is the last script i wanna fix :
code
========================================
-----------------------------------------------------------------------------------
--rdprotection.lua by Romulus (C) 2003-04-09
--RomulusHubSecurity-addon3
--
--Protects the hub from vigilant Operators redirecting all users to another hub.
--
--
-----------------------------------------------------------------------------------
--Enter your admins names (or atleast those who should have the
--ability to turn this function off - and don΄t forget to give
--them the magic word in a safe environment):
admins = {"LiqUiD~TrolL"}
botname="-RD-Protection-"
--Choose a magicword. This word is used if you want to turn off the function.
--There is no help in this script, that would be stupid ;)
--You have to remember your magic word, and the command to turn of the rdprotection.
--
--Note: Even when the function is turned off only Operators listed above can redirect users.
--Ordinary operators will always get kicked ;)
--
--To turn off the rd protection type:
-- +rdprotect off YourMagicWord in a pm to the bot
--To turn it back on again:
-- +rdprotect on YourMagicWord in a pm to the bot
TheMagicWord="liquid"
--------You can, but should not edit these:
rdwarn = 3
rdwarn2 = 5
rddiss = 10
rdban = 15
-------------------------------------------------
---DO NOT EDIT BELOW THIS TEXT!!!
-------------------------------------------------
EnableRedirr=0
function Main()
frmHub:RegBot(botname)
SendToOps(botname, "This hub is now protected against OpForceMove! ("..ver..")")
end
redirr={}
redirrCounter=0
function checkAdmath.min(user)
Admath.min = 0
for key, CheckOp in admins do
if user.sName == CheckOp then
Admath.min = 1
end
end
end
ver="RomulusHubSecurity-Addon3"
function DataArrival(user, data)
s,e,whoTo,from=string.find(data, "$To:%s+(%S+)%s+From:%s+(%S+)")
if whoTo==botname then
s,e,cmd,arg,magicword = string.find( data, "%b<>%s+(%S+)%s+(%S+)%s+(%S+)" )
if (user.bOperator) then
checkAdmath.min(user)
if Admin==1 then
if (cmd=="+rdprotect") then
magicword=string.sub(magicword,1,string.len(magicword)-1)
if (arg=="off") then
if (magicword==TheMagicWord) then
EnableRedirr=1
user:SendPM(botname, "You said the magic word! I will now allow Admins to redirect users.")
end
end
end
if (cmd=="+rdprotect") then
magicword=string.sub(magicword,1,string.len(magicword)-1)
if (arg=="on") then
if (magicword==TheMagicWord) then
EnableRedirr=0
user:SendPM(botname, "You said the magic word! The RD-Protection is now enabled. Not even Admins can redirect users.")
end
end
end
end
end
end
if string.sub(data, 1, 12) == "$OpForceMove" then
checkAdmath.min(user)
if Admin==0 then
if (redirr[user.sName] == nil) then
redirr[user.sName]=1
else
redirr[user.sName]=redirr[user.sName]+1
end
redirrCounter=redirrCounter+1
SendToOps(botname,"The Operator "..user.sName.." with ip "..user.sIP.." has OpForceMoved << "..redirr[user.sName].." >> users.")
if (redirrCounter==rdwarn) then
SendPmToNick(user.sName, botname, "Watch it "..user.sName.."! This hub is protected against OpForceMove. If you redirect to many users, you will be banned.")
end
if (redirrCounter==rdwarn2) then
SendPmToNick(user.sName, botname, "Last warning "..user.sName.."! This hub is protected against OpForceMove. If you redirect to many users, you will be banned.")
end
if (redirrCounter>=rddiss) then
SendPmToNick(user.sName, botname, "<< Taking protective actions >>> You have redirected to many users "..user.sName..", and are therefore disconnected!")
SendToAll(botname, "<< Taking protective actions >>> "..user.sName.." have redirected to many users, and is therefore disconnected!")
user:Disconnect()
end
if (redirrCounter>=rdban) then
SendPmToNick(user.sName, botname, "<< Taking protective actions >>> You have redirected to many users "..user.sName..", and are therefore banned!")
SendToAll(botname, "<< Taking protective actions >>> "..user.sName.." have redirected to many users, and is therefore banned!")
user:Ban()
end
end
end
if Admin==1 then
if EnableRedirr==0 then
if (redirr[user.sName] == nil) then
redirr[user.sName]=1
else
redirr[user.sName]=redirr[user.sName]+1
end
redirrCounter=redirrCounter+1
SendToOps(botname,"The Operator "..user.sName.." with ip "..user.sIP.." has OpForceMoved << "..redirr[user.sName].." >> users.")
if (redirrCounter==rdwarn) then
SendPmToNick(user.sName, botname, "Watch it "..user.sName.."! This hub is protected against OpForceMove. If you redirect to many users, you will be banned.")
end
if (redirrCounter==rdwarn2) then
SendPmToNick(user.sName, botname, "Last warning "..user.sName.."! This hub is protected against OpForceMove. If you redirect to many users, you will be banned.")
end
if (redirrCounter>=rddiss) then
SendPmToNick(user.sName, botname, "<< Taking protective actions >>> You have redirected to many users "..user.sName..", and are therefore disconnected!")
SendToAll(botname, "<< Taking protective actions >>> "..user.sName.." have redirected to many users, and is therefore disconnected!")
user:Disconnect()
end
if (redirrCounter>=rdban) then
SendPmToNick(user.sName, botname, "<< Taking protective actions >>> You have redirected to many users "..user.sName..", and you are therefore banned!")
SendToAll(botname, "<< Taking protective actions >>> "..user.sName.." have redirected to many users, and is therefore banned!")
user:Ban()
end
end
end
end
U can use WinMerge (http://winmerge.sourceforge.net/) to find out differences between two files easier...
Also when you post code be sure to enclose it inside
[ code]
--- code here
[ /code]
( no space after the ['s ... )
it should appear like --- code here
In this way it is easier to differentiate it from your text ...
Herodes, u took the words out of my fingers :D
well, LiqUiD~TrolL, try following his hints and have a look at plop's 425 converter. it really helps a lot in this conversion issue. after that, u just need to deal with the file handling and Arrivals.
Best regards,
jiten
well my firends i havent find the diffrences between them cause it doesn t show any diffrence =)
or i might not doing osmething correct , but i don t think so
by the way can you fix this redirect protection script???
i have in my last post???
PS the proggram seems to be really cool, tnx for the info
QuoteOriginally posted by LiqUiD~TrolL
by the way can you fix this redirect protection script???
i have in my last post???
nope... stop hi-jacking threads, this thread is about a random in outro script, if you need something else start a new thread.
ohh shit sorry m8
never imagine this,i didn t done it in purpuse of course =/
well m8 this script doesnt seem to work either
i m getting an error message :
Syntax ...PtokaX_0.3.3.0.b16.04_nt_DCinfo.insecure.lv_\scripts\Random-In-Outro.lua:1: unexpected symbol near `-'
and here is the script also
[ /code]
-// Random Intros and Outros
--// By Chaggydawg
--// Does it work?? Who knows these things??
--// Revision 0.2
HubOwner = "LiqUiD~TrolL"
intros = {
"[USERNAME] Crawls In On Their Hands And Knees.",
"In A Fiery Explosion [USERNAME] Appears.",
"With A Crazed Look In Their Eyes [USERNAME] Arrives.",
"Sir [USERNAME] Of The East Lunatic Fringe Has Arrived.",
"[USERNAME] Arrives Yelling And Screaming Like A Maniac.",
"[USERNAME] Arrives Ranting And Raving About Aliens Or Some Such Rot.",
"The Demented [USERNAME] Has Arrived.",
"[USERNAME] Appears Out Of Nowhere And Begins Speaking In Tongues.",
"[USERNAME] Arrives And Immediately Heads For The Light Like A Moth.",
"[USERNAME] Climbs In Through The Window With A Big Joint.",
"[USERNAME] Falls From The Skylight And Lands On A Mushroom.",
"[USERNAME] Enters the Room With A Bottle Of L.S.D On His Hands.",
"After Alot Of Loud Groaning [USERNAME] Comes Waltzing Out Of Janines Room...",
"Hair In Everywhich Direction [USERNAME] Arrives On The Scene Looking More Crazed Than Usual.",
"Brandishing What Looks Like A Hairbrush [USERNAME] Arrives.",
"[USERNAME] Arrives An ElfGirl Under Each Arm",
"[USERNAME] Appears Out Of Thin Air Scaring The Hell Out Of Janine.",
"[USERNAME] Parachutes In From An Airplane.",
"[USERNAME] Runs In, Stubs Their Toe On A Couch And Falls Over A Table Landing On Janine.",
"[USERNAME] Crashes Through The East Wall Arriving In The Hub.",
"[USERNAME] is here, How about a round of elfgirls for everyone?",
}
outros = {
"[USERNAME] Has Left The Hub",
"Jumping Through A Plate-Glass Window [USERNAME] Leaves The Hub With His SnowBoard.",
"Aliens Rocks Abduct [USERNAME], And They Are Gone.",
"[USERNAME] Begins Shrinking, And Eventually Disappears From The Hub.",
"Janine Takes [USERNAME] By The Arm And Leads Them To Her Room Closing The Door.",
"With Cat Like Reflexes [USERNAME] Leaps Out The Window And Is Gone.",
"The Lights Momentarily Dim, And When They Come Back On [USERNAME] Is Gone.",
"Three Giant Men In White Coats March In And Haul Away [USERNAME] Kicking and Screaming.",
"[USERNAME] Leaves Through The Basement Door",
"[USERNAME] Accidentally Walks Into Janines Room, Muffled Screams Are Heard For A Few Seconds But [USERNAME] Is Gone.",
"Suddenly [USERNAME] Leaps Up And Bolts For The Door.",
"[USERNAME] Tosses A Ten On Janine Dresser And Walks Out The Door.",
"[USERNAME] Runs Around The Room Screaming & Laughing *ACID.ACID.ACID*.",
}
--// This function is fired when an operator enters the hub
function OpConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if GetProfileName(curUser.iProfile) == "Master" then LevelBot = "Administrator" end
if curUser.sName == HubOwner then LevelBot = "Hub Owner" end
intro, x = string.gsub(intros[math.random(1,table.getn(intros))], "%b[]", curUser.sName)
SendToAll(LevelBot, intro)
end
--// This function is fired when an operator disconnects
function OpDisconnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if GetProfileName(curUser.iProfile) == "Master" then LevelBot = "Administrator" end
if curUser.sName == HubOwner then LevelBot = "Hub Owner" end
outro, x = string.gsub(outros[math.random(1,table.getn(outros))], "%b[]", curUser.sName)
SendToAll(LevelBot, outro)
end
--// This function is fired when a new user finishes the login
function NewUserConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
intro, x = string.gsub(intros[math.random(1,table.getn(intros))], "%b[]", curUser.sName)
SendToAll(LevelBot, intro)
else
end
end
--// This function is fired when an user disconnects
function UserDisconnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
outro, x = string.gsub(outros[math.random(1,table.getn(outros))], "%b[]", curUser.sName)
SendToAll(LevelBot, outro)
else
end
end
Yikes, another copy error ;)
That error is because u didn't copy everything from the beginning.
In the first line of the script it should be:
--// Random Intros and Outros
and not
-// Random Intros and Outros
As u see, u missed one "-" in the code I posted. Pay attention next time ;)
Cheers..