PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: Daywalker? on 12 November, 2006, 23:23:11

Title: Network Check
Post by: Daywalker? on 12 November, 2006, 23:23:11
maybe usefull.........or not, judge for urself :)
--[[

Network Control LUA 5.1 version by Daywalker?


CHANGELOG:
*********** Daywalker? ********************************************************************
- Added Toggle All or only offline hubs on/of also in RC
- Added commands for help, show, add and delete
- Added table for adding hubs
- Added RC Commands
- Added pxwsa_l51.dll from blue_bear for pinging online hubs in table

NOTE: make a textfile called network.dat in the script folder for table :)
NOTE2: put the pxwsa_l51.dll, cc3270.dll and the pxwsa_l51.tds in the Ptokax root folder

  known Commands are !addhub !delhub !showhub !checkon !allon !alloff and !hubhelp

********************************************************************************************************

]]--


;D

Download ??????HubControl?????? (http://yourlink.eu/daywalker/scripts/HubControl%20v%20H.01.rar)
Title: Re: Network Check
Post by: achiever on 31 January, 2007, 19:51:07
hi,

i needed a bit of addition to this script.

can some 1 plzz make it such that this should check each hub after some time interval and store the information of it being online or not and when some 1 types the commands to check online hubs it should show the recent updated information.
by this i mean it should not check the hubs ON at that moment but keep on checking hubs at an interval of say 10 mins and keep on refreshing the stored information and on the command it should return this data.

thks

achiever
hi  :(

no reply YET.
dunno if my request was not understood or something else. but can some 1 plzz make the changes i needed.

thks,

achiever
Title: Re: Network Check
Post by: bastya_elvtars on 31 January, 2007, 19:54:13
Hub pinger redirect manager does exactly this.
Title: Re: Network Check
Post by: Yahoo on 25 March, 2007, 16:11:21
can this script be edited so that it can check not only check internet hub but also LAN hubs
Title: Re: Network Check
Post by: achiever on 30 May, 2007, 07:56:20
hi,

Quote from: bastya_elvtars on 31 January, 2007, 19:54:13
Hub pinger redirect manager does exactly this.
can the redirecting part of the redierct manager be removed and made functional just as a hub manager, where all can add new hubs, their addresses and name of Operator to contact for registration and it will check it will keep on checking for online hubs every 4-5 mins (resetable time) and store the data in a text file and and display this on a command.

thks.
Title: Re: Network Check
Post by: Psycho_Chihuahua on 30 May, 2007, 10:20:50
-Rick-'s Online Check script does exactly that. Search the Forum
Title: Re: Network Check
Post by: achiever on 30 May, 2007, 16:19:59
yes i have it but can i needed some thing which can be used by all my users so i needed this.
as users can type a command like +hubs and get to kno which all hubs are on

can ne 1 plzz help me out.

thks.
Title: Re: Network Check
Post by: Psycho_Chihuahua on 30 May, 2007, 21:51:53
and again...

-Ricks- OnlineCheck does that, it also makes a html you can use as website.

from inside the hub you can check the status of the listed hubs

[16:35:56] <-SanitariuM->
=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=
Online list with [1] Hub(s)

=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=

[1] online.hub.org:9999

[16:36:02] <-SanitariuM->
=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=
Offline list with [1] Hub(s)

=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=

[1] offline.hub.org:411

[16:36:10] <-SanitariuM->
=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=
Array list with [15] Hub(s)

=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=

[1] online.hub.org:9999
[2] offline.hub.org:411


all you need to do is alter the settings so the users can add/read the list.

To get the hubscript part of it however you will have to make some alterations for newer ptokax, but if i could do it so can you. I'm not serving everything on a silver platter
you can read more about the script/application i am talking about here (http://forum.ptokax.org/index.php?topic=6066.0)

also i have updated the script to newer PtokaX version 0.3.6.0 and set the RC Menu to appear for all users so be carefull if you dont trust your users, they could empty the list ^^ (this is very easy to change however)
Title: Re: Network Check
Post by: achiever on 21 June, 2007, 10:07:06
hi,

can u plzz make the provision such that hub names can also be seen along with their address and also if no port added then 411 as the default port.

i wouldnt have asked if i could do it,

thanks for help,
achiever.
no reply :(
Title: Re: Network Check
Post by: Psycho_Chihuahua on 21 June, 2007, 12:01:04
2 possibilities


1. ask Rick to do this (i have already and he hasnt been able to so far)

2. try it yourself (and you will see what i spent a loooooooooong time on trying to do)

the problem is that the pinger would have to be rewritten and i have never been able to get it to work after making changes to it
Title: Re: Network Check
Post by: achiever on 23 June, 2007, 15:08:04
ohk i think then we cant do nething but w8

thanks,
achiever.
hi,

i made the script with the the specs mentioned above plzz give it a try.
and can some 1 plzz add the delete function such that ppl can delete only their entries and masters can delete any.
also while adding hub name it should be of just 1 word and the second word should be of address :(
as i m still having difficulties with capture pattern,s so can some 1 plzz change it to some thing which will allow multi-word hub name and identify Ips' specificly.

--commands onlinecheck "hubs"; list all hubs "allhubs"; add new hub "addhub hub-name address"
--code taken and modified to suit requierments from mutor's message board script :-) , by achiever

Hub = frmHub:GetHubName()
sBot = frmHub:GetHubBotName()
Bot = ("Online checker")
filename = ("onlinecheck/Allhubs.dat")
filename1 = ("onlinecheck/Array.tbl")
filename2 = ("onlinecheck/Online.tbl")
--End User Settings----------------------------------------------------------------------------------

Hub_Board = {}
tArray = {}
tOnline ={}

function Main()
if loadfile(filename) then
dofile(filename)
else
Hub_Board = {}
SaveToFile(filename , Hub_Board , "Hub_Board")
end
if loadfile(filename1) then
dofile(filename1)
else
Hub_Board = {}
SaveToFile(filename1 , tArray , "tArray")
end
if loadfile(filename2) then
dofile(filename2)
else
Hub_Board = {}
SaveToFile(filename2 , tOnline , "tOnline")
end
end

NewUserConnected = function(user)
user:SendData("$UserCommand 1 3 "..Hub.."\\"..Bot.."\\ All Hubs $<%[mynick]> !allhubs||")
user:SendData("$UserCommand 1 3 "..Hub.."\\"..Bot.."\\ Online Hubs $<%[mynick]> !hubs %[nick]||")
user:SendData("$UserCommand 1 3 "..Hub.."\\"..Bot.."\\ Add Hub$<%[mynick]> !addhub %[line:Hub Name] %[line:Address]||")
--user:SendData("$UserCommand 1 3 "..Hub.."\\"..Bot.."\\ Rem arrey hub$<%[mynick]> !rem %[line:Remove hub from array]||")
end

OpConnected = NewUserConnected

function ChatArrival( user, data)
local s,e,prefix,cmd = data:find("%b<>%s+(%p)(%S+)")
if prefix then
if cmd == "addhub" then
--local _,_,Hubname,add = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(.*)")
local _,_,Hubname,add = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(%S+)|")
if Hubname and add then
if not string.find(add, ":") then
Ip = ""..add..":411"
--SendToAll(sBot, ""..Hubname.." "..Ip.."")
else
Ip = add
end
return WriteHubBoard(user,Hubname, Ip),1
else
user:SendData(sBot,"Syntax Error +addhub hubname address")
end
elseif cmd == "hubs|" then
return ReadHubs(user),1
elseif cmd == "allhubs|" then
return ReadAllHub(user),1
end
end
end
ToArrival = ChatArrival

function ReadHubs(user)
local dsp = ""
local str = "\r\n\t\t "..table.getn(tOnline).." Hub(s) are Online\r\n\t\t"
str = str..""..string.rep("--",40).."\r\n\t\t"
local temp = ""
for i = 1,table.getn(tOnline) do
temp = tOnline[i]
for i,v in ipairs(Hub_Board) do
if v[2] == temp then
str = str..""..v[1].."\t\t"..temp.."\r\n\t\t"
end
end
end
dsp = dsp..str
user:SendData(sBot, dsp)
end

function ReadAllHub(user)
local dsp = ""
local str = "\r\n\t\t "..table.getn(tArray).." Hub(s) are listed:-\r\n\t\t"
str = str..""..string.rep("--",40).."\r\n\t\t"
for i,v in ipairs(Hub_Board) do
str = str..i..") "..v[1].."\t\t"..v[2].."\r\n\t\t"
end
dsp = dsp..str
user:SendData(sBot, dsp)
end

function WriteHubBoard(user, Hubname, Ip)
if Hubname and Ip then
table.insert(Hub_Board,{Hubname, Ip})
table.insert(tArray, Ip)
SaveToFile(filename , Hub_Board , "Hub_Board")
SaveToFile(filename1 , tArray , "tArray")
end
local dsp ="Ur Hub Data is entered"
user:SendData(sBot, dsp)
collectgarbage(gc)
end

function Serialize(tTable, sTableName, sTab)
assert(tTable, "tTable equals nil")
assert(sTableName, "sTableName equals nil")
assert(type(tTable) == "table", "tTable must be a table!")
assert(type(sTableName) == "string", "sTableName must be a string!")
sTab = sTab or ""
sTmp = ""
sTmp = sTmp..sTab..sTableName.." = {\n"
for key, value in ipairs(tTable) do
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key)
if(type(value) == "table") then
sTmp = sTmp..Serialize(value, sKey, sTab.."\t")
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value)
sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
end
sTmp = sTmp..",\n"
end
sTmp = sTmp..sTab.."}"
return sTmp
end

function SaveToFile(file , table , tablename)
local handle = io.open(file,"w+")
handle:write(Serialize(table, tablename))
handle:flush()
handle:close()
collectgarbage(gc)
end


any suggestions, plzz post :)

achiever.
Title: Re: Network Check
Post by: Psycho_Chihuahua on 23 June, 2007, 15:52:05
read the last line in my last post!
Title: Re: Network Check
Post by: achiever on 23 June, 2007, 16:38:28
yeah what about it?

dude the script i posted works allright. just some precautions :P
Title: Re: Network Check
Post by: bastya_elvtars on 23 June, 2007, 17:26:12
Why don't you ask for help if you are having problems with pattern matching? I, for one, like to teach.
Title: Re: Network Check
Post by: achiever on 23 June, 2007, 17:33:04
oh yes please
Title: Re: Network Check
Post by: jack_port1000 on 22 July, 2007, 00:20:37
cany any one chage achiever script for 0.3.6.0 its goog script but not work in 3.6.0.
i got this error please some one help

Syntax ...AGAT.JAGIRDAR\Desktop\New Folder (2)\scripts\hub.lua:136: attempt to index local 'handle' (a nil value)
there is no error in script but when i add hub and check online hub or all hub its not showing any thing but only right click show tat all option but not work i can able to add hub name and hub addy but in rply nothing please some one help :'( :'( :'(
Title: Re: Network Check
Post by: jack_port1000 on 22 July, 2007, 09:03:17
tanx Mutor for your help , but i already created onlinecheck folder in script folder but i want to know tat i must have to use this thing?  array_beta_PCedited.rar (257.34 KB - downloaded 17 times.) posted by Psycho_Chihuahua, if yes then i have to change any thing in tat i mean edit any thing for my hub? and i want to show only lan hub in my hub
Title: Re: Network Check
Post by: jack_port1000 on 22 July, 2007, 23:50:44
i want to use achiever script for tat i did script and one folder as onlinecheck  place in script folder right? any  thing eals i have to keep with tat? bec i did this both thing and there is no error right now but network check not work in hub so wat the problem now i want to know
sorry for my bad english
i add this three hubs its all online but not showing any hub online and right clicke not work to addhubs,hubs,onlinehubs this all thing work by command in main chat like +addhub,+hubs,+allhubs
there is no error in script so plase help Mutor or any one who know this


<---=[N.W.O]=---> Ur Hub Data is entered
<---=[N.W.O]=---> Ur Hub Data is entered
<---=[N.W.O]=---> Ur Hub Data is entered
<---=[N.W.O]=--->
3 Hub(s) are listed:-
--------------------------------------------------------------------------------
1) Alley   172.16.XX.X:411
2) NET   172.16.X.XX:411
3) sh's   172.16.XX.XXX:411

<---=[N.W.O]=--->
0 Hub(s) are Online
--------------------------------------------------------------------------------

<---=[N.W.O]=--->
0 Hub(s) are Online
--------------------------------------------------------------------------------


Title: Re: Network Check
Post by: Psycho_Chihuahua on 24 July, 2007, 00:08:14
well with the one i have you can add and delete hubs from the list, it shows online/offline hubs BUT that only works if the onlinecheck mpps exe is running
Title: Re: Network Check
Post by: jack_port1000 on 24 July, 2007, 01:06:45
will run, but can u please post script and mpps exe here i mean whole thing?
Thax for ur help
swagat_j
Title: Re: Network Check
Post by: Psycho_Chihuahua on 24 July, 2007, 09:37:49
Quote from: jack_port1000 on 24 July, 2007, 01:06:45
will run, but can u please post script and mpps exe here i mean whole thing?
Thax for ur help
swagat_j

If you would take the time to read some of the above posts you would of noticed that it is there already!

http://forum.ptokax.org/index.php?action=dlattach;topic=6552.0;attach=643
Title: Re: Network Check
Post by: jack_port1000 on 24 July, 2007, 10:59:41
its great working tanx a lot
is it possible in ur script is option to add hub add only can u pls edit tat we can add also hub name like this

1. BackAlley          172.16.xx.xx
2. Hunter              172.16.x.xx

Title: Re: Network Check
Post by: Psycho_Chihuahua on 24 July, 2007, 13:14:36
Quote from: Psycho_Chihuahua on 21 June, 2007, 12:01:04
the problem is that the pinger would have to be rewritten and i have never been able to get it to work after making changes to it
Title: Re: Network Check
Post by: achiever on 24 July, 2007, 17:28:54
jack_port1000,
use the script i have posted in addition to the great mpps.exe and u will be fine.

achiever.