PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Psycho_Chihuahua on 07 August, 2004, 10:51:52

Title: prob with gadgets hubinfo script
Post by: Psycho_Chihuahua on 07 August, 2004, 10:51:52
the way i see it, this is supposed to help with the displaying of the hub on hublist.org....hmmmm well most of the time i end up with a displayed amount of 0 users. Ok Ok i dont havean enormouse amount of Users (52 od which 30 are almost always online.
hmm maybe the script has a minor mistake in it or sumthing. Just in case, could someone help me out here.

I have a Registered Only Hub, but i registered the HubPinger as a User. but i would like Min-MaxHubs/Min-MaxSlots displayed as well.

--// HubINFO-BotINFO support script for PtokaX by Gadget

--// Optional hubowner's email address for editing hub info in [URL]www.hublist.org[/URL]

OwnerEmail="someone@somewhere.com"

--// No need to edit other settings

MinSlots=0
MaxHubs=5
function Main()
HubAddress=GetFromIni("HubAddress")..":"..GetFromIni("HubPort")
if GetFromIni("MinSlotsChecker")=="1" then
MinSlots=GetFromIni("MinSlots")
end
if GetFromIni("HubChecker")=="1" then
MaxHubs=GetFromIni("MaxHubs")
end
end

function DataArrival(curUser,data)
if strsub(data,1,9)=="$BotINFO " then
curUser:SendData("$HubINFO "..frmHub:GetHubName().."$"..HubAddress.."$"..frmHub:GetHubDescr().."$"..frmHub:GetMaxUsers().."$"..floor(frmHub:GetMinShare()*1048576).."$"..MinSlots.."$"..MaxHubs.."$PtokaX 0.3 ".._VERSION.." script$"..OwnerEmail)
end
end

function GetFromIni(var)
local result=""
readfrom("../PtokaX.ini")
while 1 do
local line=read()
if line==nil then
break
else
if strsub(line,1,strlen(var)+1)==var.."=" then
result=strsub(line,strlen(var)+2,strlen(line))
break
end
end
end
readfrom()
return result
end
Title:
Post by: plop on 07 August, 2004, 14:27:52
are you using a script 2 check for slots/hub's??
if so this script the settings from ptokax itself (the vallue's you see on the ptokax console).
2 solve this you can replace function Main and set your slot/hub settings manualy in gadget's script.
replace function Main for this 1.
function Main()
   HubAddress=GetFromIni("HubAddress")..":"..GetFromIni("HubPort")
end

plop
Title:
Post by: Flow84 on 03 November, 2004, 03:43:08
Hi.

if i send:$BotINFO |

i get:$HubINFO FlowTestHub$flow84.no-ip.org:411$Testing Hub description$100$0$0$0$PtokaX 0.3 Lua 4.0.1 script$

and then i get disconnected...

i have tested this script on:
Ptokax 0.3.2.6 TestDrive 4.00 b
Ptokax 0.3.2.6 TestDrive 4.99

I send the $BotINFO to the hub after geting geting first main chat message.

in my test hub it is after geting

i have tested to send $BotINFO | after geting $Hello

but the it doesnt even reply with $HubINFO... and i dont get disconnected.

what do i do wrong?

this is the raw log:

$Lock DqACwP:R`58A$HubName FlowTestHub
Den h?r hubben k?r PtokaX DC Hub 0.3.2.6 TestDrive 4.99  (UpTime: 0 hours, 5 minutes)
$Hello Test
Welcome to PtokaX
+statbot
$NickList PtokaX$$OpChat$$[Owner]Flow84$$Test$$
$OpList PtokaX$$OpChat$$[Owner]Flow84$$
$MyINFO $ALL [Owner]Flow84 <++ V:0.401,M:A,H:1/3/6,S:2>$ $DSL$$0$
$MyINFO $ALL Test Test Version$ $BOT$$0$
$MyINFO $ALL Test Test Version$ $BOT$$0$
Title:
Post by: Flow84 on 03 November, 2004, 20:31:22
it is now solved :D

function DataArrival(curUser,data)
   if strsub(data,1,9)=="$BotINFO " then
      curUser:SendData("$HubINFO "..frmHub:GetHubName().."$"..HubAddress.."$"..frmHub:GetHubDescr().."$"..frmHub:GetMaxUsers().."$"..floor(frmHub:GetMinShare()*1048576).."$"..MinSlots.."$"..MaxHubs.."$PtokaX 0.3 ".._VERSION.." script$"..OwnerEmail)
      return 1
   end

end