PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: B@B? on 13 May, 2005, 11:10:43

Title: Hubjump
Post by: B@B? on 13 May, 2005, 11:10:43
Maybe someone can make an Lua 5-Script from
this one wich was runnin perfectly with Lua 4.

--*****Hub-Jump*****

botname = " "
hubA = "Blabla.no-ip.com"
hubB = "Blabla.dyn.dns"
hubC = "Blabla.orgdns.org"
hubD = "Blabla.no-ip.com:777"

hubsA = "#hubA"
hubsB = "#hubB"
hubsC = "#hubC"
hubsD = "#hubD"

cmd = "#jump"

function DataArrival(user, data)
if (strsub(data, 1, 1) == "<") then
data = strsub(data,1,strlen(data)-1)
if (strfind(strlower(data), strlower(hubsA))) then

user:SendData(Bot, "Umleitung nach: "..hubA.."")
user:SendData(botname, "Umleitung nach: "..hubA.."|$ForceMove "..hubA.."|")

elseif (strfind(strlower(data), strlower(hubsB))) then
user:SendData(Bot, "Umleitung nach: "..hubB.."")
user:SendData(botname, "Umleitung nach: "..hubB.."|$ForceMove "..hubB.."|")

elseif (strfind(strlower(data), strlower(hubsC))) then
user:SendData(Bot, "Umleitung nach: "..hubC.."")
user:SendData(botname, "Umleitung nach: "..hubC.."|$ForceMove "..hubC.."|")

elseif (strfind(strlower(data), strlower(hubsD))) then
user:SendData(Bot, "Umleitung nach: "..hubD.."")
user:SendData(botname, "Umleitung nach: "..hubD.."|$ForceMove "..hubD.."|")

elseif (strfind(strlower(data), strlower(cmd))) then

user:SendData(botname,  "\r\n")
user:SendData(botname,  "   ...---......---......---......---......---......---......---......---......---......---...")
user:SendData(botname, "     Hub-Netzwerk-Verbund ??? [D@] G??M@N F??? ???")
user:SendData(botname, "   ...---......---......---......---......---......---......---......---......---......---... \r\n")
user:SendData(botname, "Commands eingeben im Main-Chat:")
user:SendData(botname, "----------------------------------------------------------------------------------------------------------------------------")
user:SendData(botname, "#hubA   -   Verbinden nach "..hubA.." -   [D@] G??M@N F??? N?W! ")
user:SendData(botname, "#hubB   -   Verbinden nach "..hubB.." -   [D@] G??M@N F??? Pf@lz")
user:SendData(botname, "#hubC   -   Verbinden nach "..hubC.." -   [D@] G??M@N F??? B@y?rn" )
user:SendData(botname, "#hubD   -   Verbinden nach "..hubD.." -   [D@] G??M@N F??? B@d?n" )

user:SendData(botname, "----------------------------------------------------------------------------------------------------------------------------")
end
end
end

Thx
Title:
Post by: 6Marilyn6Manson6 on 13 May, 2005, 23:21:08
--//HubJump
--//Additional Scripting Help By Piglja
--//June 1st 2003
--//Converted by 6Marilyn6Manson6 by 13/05/2005

botname = "[ITA]JumpY"

hubA = "Blabla.no-ip.com"
hubB = "Blabla.dyn.dns"
hubC = "Blabla.orgdns.org"
hubD = "Blabla.no-ip.com:777"
hubsA = "!hubA"
hubsB = "!hubB"
hubsC = "!hubC"
hubsD = "!hubD"
cmd = "!jump"

function ChatArrival(user, data)
data = string.sub(data,1,string.len(data)-1)
if (string.find(string.lower(data), string.lower(hubsA))) then
user:SendData(botname, "Redirecting to: "..hubA.."")
user:SendData(botname, "Redirecting to: "..hubA.."|$ForceMove "..hubA.."|")
elseif (string.find(string.lower(data), string.lower(hubsB))) then
user:SendData(botname, "Redirecting to: "..hubB.."")
user:SendData(botname, "Redirecting to: "..hubB.."|$ForceMove "..hubB.."|")
elseif (string.find(string.lower(data), string.lower(hubsC))) then
user:SendData(botname, "Redirecting to: "..hubC.."")
user:SendData(botname, "Redirecting to: "..hubC.."|$ForceMove "..hubC.."|")
elseif (string.find(string.lower(data), string.lower(hubsD))) then
user:SendData(botname, "Redirecting to: "..hubD.."")
user:SendData(botname, "Redirecting to: "..hubD.."|$ForceMove "..hubD.."|")
elseif (string.find(string.lower(data), string.lower(cmd))) then
user:SendData(botname, "----------------------------------------------------------------------------")
user:SendData(botname, "Hub Affiliates Of 420 ??+?r????")
user:SendData(botname, "----------------------------------------------------------------------------")
user:SendData(botname, "Type These Commands In Main Chat:")
user:SendData(botname, "----------------------------------------------------------------------------")
user:SendData(botname, "!hubA - let's U connect to "..hubA.." - [D@] G??M@N F??? N?W! ")
user:SendData(botname, "!hubB - let's U connect to "..hubB.." - [D@] G??M@N F??? Pf@lz")
user:SendData(botname, "!hubC - let's U connect to "..hubC.." - [D@] G??M@N F??? B@y?rn")
user:SendData(botname, "!hubD - let's U connect to "..hubD.." - [D@] G??M@N F??? B@d?n")
user:SendData(botname, "----------------------------------------------------------------------------")
end
end

c ya ;)
Title:
Post by: Dessamator on 13 May, 2005, 23:23:40
that one is simple even u can convert it on ur own, first of all use nightlitch's lua4--> 5 converter ,then change /rename the dataarrival to "ChatArrival", then remove the line

if (strsub(data, 1, 1) == "<") then

and one of the "end" at the bottom, and voila it should work.


Good luck !!
Title:
Post by: B@B? on 13 May, 2005, 23:28:14
WAOW!  :P

Tested and NO ERROR @ this time...

Thank YOU v. m. @ MM and Dessamator ;)
Title:
Post by: 6Marilyn6Manson6 on 13 May, 2005, 23:37:21
QuoteOriginally posted by B@B?
WAOW!  :P

Tested and NO ERROR @ this time...

Thank YOU v. m. @ MM and Dessamator ;)


no prob ^_^
Title:
Post by: 6Marilyn6Manson6 on 13 May, 2005, 23:44:31
Post edit... c ya
Title:
Post by: Dessamator on 14 May, 2005, 10:35:56
QuoteOriginally posted by B@B€
WAOW!  :P

Tested and NO ERROR @ this time...

Thank YOU v. m. @ MM and Dessamator ;)

ur welcome, :)
Title:
Post by: jiten on 14 May, 2005, 12:53:36
-- Lua 5 version by jiten
--//HubJump

sBot = frmHub:GetHubBotName()

tHubs = {
{ ["domain"] = "hub1.no-ip.com", ["desc"] = "[D@] G??M@N F??? N?W!", ["cmd"] = "cmd1" },
{ ["domain"] = "hub2.dyn.dns", ["desc"] = "[D@] G??M@N F??? Pf@lz", ["cmd"] = "cmd2" },
{ ["domain"] = "hub3.orgdns.org", ["desc"] = "[D@] G??M@N F??? B@y?rn", ["cmd"] = "cmd3" },
{ ["domain"] = "hub4.no-ip.com:777", ["desc"] = "[D@] G??M@N F??? B@d?n", ["cmd"] = "cmd4" },
}

function ChatArrival(user, data)
local data = string.sub(data,1,-2)
local s,e,cmd = string.find (data, "%b<>%s+[%!%?%+%#](%S+)" )
local border,msg = "\r\n\t"..string.rep("-",80).."\r\n\t",""
if string.lower(cmd) == "jump" then
msg = msg..border.."Hub Affiliates Of 420 ??+?r????"..border.."Type These Commands In Main Chat:"..border
for i=1,table.getn(tHubs) do
msg = msg..tHubs[i]["cmd"].." - let's U connect to "..tHubs[i]["domain"].." - "..tHubs[i]["desc"].."\r\n\t"
end
msg = msg..border return user:SendData(sBot, msg),1
end
for i,v in tHubs do if string.lower(cmd) == string.lower(v.cmd) then user:Redirect(v.domain,v.desc) end end
end
Best regards,

jiten
Title:
Post by: Dessamator on 14 May, 2005, 13:32:01
well done, very clean code :)
Title:
Post by: B@B? on 14 May, 2005, 13:47:26
Merzi, Herzi! :P
Title:
Post by: jiten on 15 May, 2005, 10:45:58
anytime :]

Btw, that does Herzi means? :rolleyes:

Cheers
Title: How to change.....
Post by: XPMAN on 17 May, 2005, 18:14:15
What would you have to do to the hubjump script to stay in the existing hub you are in and the hub u jump to just open in another tab, like it would if you manually entered 2 different hubs?  The way the script is now you totally leave the hub u r in. I know the script is called "hubjumb" ..lol, but it would be a nice feature.

Anyone know how to do this ?
Title:
Post by: jiten on 17 May, 2005, 18:22:15
QuoteOriginally posted by XPMAN
What would you have to do to the hubjump script to stay in the existing hub you are in and the hub u jump to just open in another tab, like it would if you manually entered 2 different hubs?  The way the script is now you totally leave the hub u r in. I know the script is called "hubjumb" ..lol, but it would be a nice feature.

Anyone know how to do this ?
Unfortunately and if I'm not wrong, that's not possible through scripting.

Cheers
Title:
Post by: Dessamator on 17 May, 2005, 18:44:52
QuoteOriginally posted by jiten
QuoteOriginally posted by XPMAN
What would you have to do to the hubjump script to stay in the existing hub you are in and the hub u jump to just open in another tab, like it would if you manually entered 2 different hubs?  The way the script is now you totally leave the hub u r in. I know the script is called "hubjumb" ..lol, but it would be a nice feature.

Anyone know how to do this ?
Unfortunately and if I'm not wrong, that's not possible through scripting.

Cheers

indeed, i think only a client can open another hub tab ! its like trying to send the raw /fav cmd to the client, its quite improbable for now at least !
Title: THanks
Post by: XPMAN on 18 May, 2005, 05:49:04
Well thanks for the reply guys :)  Maybe in the future something like this may be possible.
Title:
Post by: James on 18 May, 2005, 10:16:05
Hi

Is possible to change this Script ?
not for hub-jump only for www-jump ...

Example:
cmd1-google
cmd2-sourceforge
cmd3-board
  etc.....
Title:
Post by: Dessamator on 18 May, 2005, 10:26:56
QuoteOriginally posted by James
Hi

Is possible to change this Script ?
not for hub-jump only for www-jump ...

Example:
cmd1-google
cmd2-sourceforge
cmd3-board
  etc.....

nop !
Title:
Post by: B@B? on 22 May, 2005, 14:54:45
QuoteOriginally posted by jiten
anytime :]

Btw, that does Herzi means? :rolleyes:

Cheers

Sorry dear, had?nt seen this post... :rolleyes:

Merzi (Merci) normaly...chrchr

and Herz(i) is an heart  ;)

The "i" is an form to say something very nicely...

Think, in english it would mean: Hearty ^^  :D