PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: FrancoS on 30 June, 2005, 00:04:54

Title: URGENT!! HubInfo.lua translation from 4 to 5
Post by: FrancoS on 30 June, 2005, 00:04:54
This script is really needed 'cause testing PtokaX DC Hub 0.3.3.1 [debug] I verified it is not supporting hublist pinger  correctly.. anyway:

since two days ago I started the new ptokax and users stats on the www.hublist.org ARE GONE...

have a look here http://www.hublist.org/?p=hub&id=53749

so please somebody translate this script from lua 4 to lua 5

Quote-- script begin

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

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

OwnerEmail="owner@hub.com"

--// No need to edit other settings

MinSlots=0
MaxHubs=0
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

--- scrip end


in addition to what is red I know also that change the string functions is needed... but I'm not sure about the rest.

Thank you if you translate it

Regards

Robert
Title: HubInfo.lua lua 5 version
Post by: FrancoS on 30 June, 2005, 00:11:16
This is the HubInfo.lua translated in lua 5.

Sorry, did not found it before (either if I searched it)

found it right now and...

... going to see into two days if it does work.

Bye

Robert

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



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


OwnerEmail="xxx@xxx"


--// No need to edit other settings



MinSlots=0

MaxHubs=0



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 BotINFOArrival(curUser, Data)   

   curUser:SendData("$HubINFO "..frmHub:GetHubName().."$"..HubAddress.."$"..frmHub:GetHubDescr().."$"..frmHub:GetMaxUsers().."$"..math.floor(frmHub:GetMinShare()*1048576).."$"..MinSlots.."$"..MaxHubs.."$PtokaX 0.3 ".._VERSION.." script$"..OwnerEmail)



end



function GetFromIni(var)

local result=""
local file = io.open("../PtokaX.ini","r")

      while 1 do

      local line=io.read()

         if line==nil then

         break

      else

         if string.sub(line,1,string.len(var)+1)==var.."=" then

            result=string.sub(line,string.len(var)+2,string.len(line))

            break

         end

      end

   end

io.read()

io.close()

return result

end
Title:
Post by: Tw?sT?d-d?v on 30 June, 2005, 07:24:22
Hi Hublist pingers are supported on PtokaX 0.3.3.1  :D ....There was a prob to start with but not prob with P/X, prob was with pinger itself.Which as since been fixed :D
Title:
Post by: FrancoS on 30 June, 2005, 09:39:47
Maybe be

but also with the translated script... it is not working

check link at top and see yourself.

Hub is online but users are not counted...

HEEELP!!!!
Title:
Post by: ??????Hawk?????? on 30 June, 2005, 17:12:00
PX does a perfect job of HubList entry  without the need for scripting..

theres no code in my script for it ..


??????Hawk??????
Title:
Post by: FrancoS on 30 June, 2005, 20:40:14
Maybe

have a look here http://www.hublist.org/?p=hub&id=53749 (http://www.hublist.org/?p=hub&id=53749)

until it was ptokax 326 with the HubInfo.lua script, users were counted correctly...

and please note... running 326 without that script makes the same problem that I have right now that I upgraded to 331.

So, if you know special Ptokax settings for the hublist pinger... well: tell them to me... if not, juast have a look to the hub stats @ the above link and see.

Thank you

Robert
Title:
Post by: Tw?sT?d-d?v on 30 June, 2005, 21:02:07
No special settings required .... only thing you can set is reporting hub pinger to op's
mine works fine :]
check here (http://www.hublist.org/?p=hub&id=134907)

Have you got an ip script running thats stopping the pinger getting in to check hub ?(
Title:
Post by: FrancoS on 30 June, 2005, 21:13:51
I have migrated all my scripts to lua 5.

There is one that ensures the access to dc++ only clients but it is not changed and was there also with previous version 326.
Title:
Post by: ??????Hawk?????? on 30 June, 2005, 21:35:35
PtokaX 0.3.3.1

this version of Ptokax reports to Pingers no problem.

no script required..
Title:
Post by: FrancoS on 30 June, 2005, 22:50:58
but the result at hublist.org is:

server ONLINE
users 0 (zero) (none) (nicht users) (nessuno)

Check the link at top. edited well I can suicide myself... my hub is disappeared from hublist.org

_____


Right now I've disabled the HubInfo.lua script.

We'll see, but I feel what will happen...


_____

Thank you for the moment