read from log
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

read from log

Started by b_w_johan, 06 January, 2005, 16:45:40

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

b_w_johan

ok im planning to make a script wich does this:

1. check how many users are in this hub
2. more then 30? redirect all others till there 30
3. more then 30 pick a user check if he is in RegisteredUsers.dat not ok check this "database"

1GB{
jan
piet
}

2GB{
dirk
pietje
}
something like those 2
 
next step check his share is it 3GB then random redirect a user to jan, piet, dirk, pietje (adresses.)
is its share less then 1GB redirect to jan or piet randomly..

this is what it should do,
but i havent got a clue on how to get started...

hope you can give me some hints im checking the rest of the forums for clues about my new script =-)
checkout http://wwhublist.com/index.php for my World Wide HubList project!

b_w_johan

#1
ok i guess this isn't gonna work no replys at all....

ive got this part of script from [UK]madman

Quote
-- By [UK]Madman
-- References - Lua Language Board

var = {["bot"] = "RegToStayBot", ["time"] = 10, ["command"] = "?notreg"}, --time is in mins before redirect
times = {},
hubs =  { hubaddress1, hubaddress2} -- list of possible hubs
   

function Main()
frmHub:RegBot(var.bot)
SetTimer(60000*(tonumber(var.time)/4))
StartTimer()
end

function NewUserConnected(Curuser)

   if Curuser.iProfile == -1 then
   times[Curuser.sName] = var.time
   Curuser:SendData (var.bot, "You have to register to stay in this hub, you currently have: "..var.time.." mins to register!")
   end
end

function UserDisconnected (Curuser)
times[Curuser.sName] = Nil
end

function OnTimer()
   for key, value in times do
   value = value - (var.time/4)
   times[key] = value

      if value == 0 then tokick = GetItemByName(key)
         times[tokick] = nil
         tokick:SendData (var.bot, "You did not register, so are now being redirected!")
         tohub = random(getn(hubs))
         tokick:SendData("$ForceMove "..hubs[tohub])


   elseif value == (var.time - tonumber(var.time)/2) then towarn = GetItemByName(key)
   towarn:SendData (var.bot, "You have not registered, you will be redirected in: "..value.." mins unless you register!")
   end
end

function DataArrival(Curuser,data)
data = strsub(data, 1, strlen(data)-1)
   if strsub(data, 1, 1) == "<" then
   s,e,cmd = strfind(data, "%b<>%s+(%S+)")

      if cmd == var.command and Curuser.bOperator then
      Curuser:SendPM (var.bot, "The following users are currently not regged:")
         for key, value in times do
         Curuser:SendPM (var.bot, key.." Has approx "..value.." mins till being redirected!")
         end
      return 1
      end
   end
end


but it gives an error at line 5 something with "=" is wrong..
but i want to get rid of the timer function cause i dont want them to register yust get them out of my hub to some other hubs ....


next problem is when i redirect to one of my hubs johan-hub.no-ip.info:666
it gives an error by the 666 (port number) so that isn't gonna work .....
ok if that really is a problem ill fix it ... antoher way but first i want this to work and im trying and trying.... but i demolished mine so now im trying again to make it work with timer function...
checkout http://wwhublist.com/index.php for my World Wide HubList project!

[UK]Madman

Fixed above in other thread , ill try and add share size wen i get a min :o)

SMF spam blocked by CleanTalk