PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Yello on 14 August, 2005, 20:46:09

Title: REQ: Modified Info Script
Post by: Yello on 14 August, 2005, 20:46:09
Hello m8s.I found many info scripts but i need some modified script with more modifications like this one:

:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::

? Hub Information:

? Name:
? Description:
? Topic:
? Uptime:
? Users: There are now of the users online
? User Peak:
? Max User Peak:
? Hub Address:
? Web Address:
? Country:
? Shared:
? Reliability:
? Rating:
? Hub Owner:
? Local Date And Time:
? There Are: 0 Hub Owner(s), 0 Master(s), 0 NetFounder(s), 0 Moderators(s), 0 Operator(s), 0 Vip(s), 0 Registered User(s)

? User Information:

? Nick:
? IP Address:
? Share:
? Slots:
? Description:
? Tag:
? Connection:
? E-Mail:
? Client & Version:
? Mode:
? Profile Name:
? Flag:
? Your Local Date And Time Is:

:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::

Can anyone script this one ?
BTW what does User Peak And Max User Peak Mean ?

Thanks in advance...
Title:
Post by: Yello on 15 August, 2005, 16:19:23
Arent there anyone who can make it ? I need this script as soon as possible. Please guys script it
Title: try
Post by: ?Tr??T_???? on 15 August, 2005, 16:34:33
i will try///
Title:
Post by: Psycho_Chihuahua on 15 August, 2005, 16:51:51
Do you mean something like this --> http://lua.uknnet.com/thread.php?sid=&postid=5192#post5192
Title: unfinished and with an error
Post by: ?Tr??T_???? on 15 August, 2005, 17:18:34
login = {
["BotName"] = "Info-Bot",
["Hubowner"] = "[']['?N]Azim",
["webadres"] = "ur web adress here",
["Forumadres"] = "http://www.jimenmickeclubforum.dyndns.info",
["minsharehub"] = "1 GB",
["helpcommand"] = "!help",
}
local kb = "1024"
local mb = kb*kb
local gb = mb*kb
local tb = gb*kb

function Main()
frmHub:RegBot(login.BotName)
end

function NewUserConnected(user)
Message(user)
end

function OpConnected(user)
Message(user)
end

--// Profile Counter
function ProfileCounter(profile)
local table, count = GetUsersByProfile(profile), 0
for i, User in table do
if GetItemByName(User) then
count = count + 1
end
end
return count
end

function Message(user)
local timeanddate = os.date("%d-%m-%Y %H:%M:%S")
local tmp = os.clock()
local weeks, days, hours, minutes, seconds = math.floor(tmp/604800), math.floor(math.mod(tmp/86400, 7)), math.floor(math.mod(tmp/3600, 24)), math.floor(math.mod(tmp/60, 60)), math.floor(math.mod(tmp/1, 60))
if frmHub:GetHubTopic() == nil then
topic = "No topic set"
else
topic = frmHub:GetHubTopic()
end
if user.sMyInfoString then
local disp = ""
doGetProfile = GetProfileName(user.iProfile) or "Not registerd (reg your self type !regme and a password of your choice in main)"
hubshare = string.format("%0.3f", frmHub:GetCurrentShareAmount()/(tb)).." TB"
local _,_,share = string.find(user.sMyInfoString, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $[^$]+[^$]%$[^$]*%$%s*(%d+)%$" )

if share then
minshare = string.format("%0.3f", tonumber(share)/gb).." GB"
else
minshare = "Corrupt"
end
border1 = " :::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?::: ?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:: :"
border2 = " :::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?::: ?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:: :"
disp = "\r\n\r\n"..border1.."\r\n"

disp = disp.."? Hub Information: "

disp = disp.." ? Name: "..frmHub:GetHubName().."\r\n"
disp = disp.." ? Description: "..frmHub:GetHubDescr().."\r\n"
disp = disp.." ? Topic: "..topic.."\r\n"
disp = disp.." ? Uptime:
disp = disp.." ? Users:
disp = disp.." ? User Peak:
disp = disp.." ? Max User Peak:
disp = disp.." ? Hub Address: "..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n"
disp = disp.." ? Web Address: "..login.webadres.."\r\n"
disp = disp.." ? Country:
disp = disp.." ? Shared: "..hubshare.."\r\n"
disp = disp.." ? Reliability:
disp = disp.." ? Rating:
disp = disp.." ? Hubowner: "..login.Hubowner.."\r\n"
disp = disp.." ? Local Date And Time: "..timeanddate.."\r\n"
disp = disp.." ? There Are: "..ProfileCounter("NetFounder").." netfoudner(s),"..ProfileCounter("master").." Master(s),"..ProfileCounter("Operator").." Operator(s),"..ProfileCounter("Vip").." Vip(s),"..ProfileCounter("reg")..", Registered user(s).\r\n\r\n"

disp = disp.."? User Information: "

disp = disp.." ? Nick: "..(user.sName or "n/a").."\r\n"
disp = disp.." ? IP Address: "..user.sIP.."\r\n"
disp = disp.." ? Share: "..minshare.."\r\n"
disp = disp.." ? Slots: "..user.iSlots.."\r\n"
disp = disp.." ? Description: "..(user.sDescription or "n/a").."\r\n"
disp = disp.." ? Tag:
disp = disp.." ? Connection: "..user.sConnection.."\r\n"
disp = disp.." ? E-Mail: "..user.sEmail.."\r\n"
disp = disp.." ? Client & Version: "..user.sClient.."\r\n":"..user.sClientVersion.."\r\n"
disp = disp.." ? Mode: "..(tMode[user.sMode] or "n/a").."\r\n"
disp = disp.." ? Profile Name: "..doGetProfile.."\r\n"
disp = disp.." ? Flag:
disp = disp.." ? Your Local Date And Time Is:

user:SendData(login.BotName, disp)

disp = nil
end
end--------------------------------------------------------------------------------
Title: ERROR
Post by: ?Tr??T_???? on 15 August, 2005, 17:19:16
[16:17] Syntax ...dministrator\My Documents\Azim (Business)\Ptokax\Ptokax\scripts\info.lua:64: unfinished string near `" ? Description:'
Title:
Post by: Psycho_Chihuahua on 15 August, 2005, 17:29:55
--PtokaX Online Users Script .03
--
--by Mutor The Ugly
--
-- This script will keep track of users logged into the hub.
-- This script creates two files, one contains
-- a the table of users, the second writes the table to an html file for use
-- on the PtokaX WebServer and the template pack.
--
--
-- Installation:
-- Just overwrite 'pxstats.lua' with this file, restart scripts
-- No need to change your HTML, script will update online users.html only
--
--
-- [7/10/05]
-- +Changes from .01
-- +Now pulls Online users list from hub
-- +Option to clear online table/html at hub/script stop
-- +OnlineFile & OnlineFile2 are created if they dont exist
-- +Added time stamp to Online table/html
-- +Changed HTML format a bit
--
--
-- [7/16/05]
-- +Changes from .02
-- +Only for version 0.3.3.0 build 17.02 or greater
-- +Option for login information

--User Settings------------------------------------------------
OnlineFile = "../html/webstats/online.dat"   --Path and filename for Online user table
OnlineFile2 = "../html/webstats/users.html" --Path and filename for Online user html
ClearOnExit = "yes" --"yes" / "no" --Clear online table/html at script stop?
HubOwner = "[Admin]Mutor" --Your Nick / Owner Nick
ShowInfo = "yes" --"yes" / "no" --Show hub/user information to new logins?
Greeting = "it's nice of you to stop by..." --Short message for new logins
--End User Settings--------------------------------------------

function Main()
local ScriptStart=os.date("%I:%M %p  %m/%d/%y ")
local StartMsg = "Online Script Started"
if loadfile(OnlineFile) ~= nil  and ClearOnExit ~="yes" then
dofile(OnlineFile)
Online[StartMsg] = ScriptStart
else
Online = {}
Online[StartMsg] = ScriptStart
end
local OnlineTab = frmHub:GetOnlineUsers()
for i = 1, table.getn(OnlineTab) do
local Login=os.date("%I:%M %p  %m/%d/%y ")
local Nickname = OnlineTab[i]["sName"]
Online[Nickname] = Login
end
Save_File(OnlineFile,Online,"Online")
SaveOnline()
end

function OnExit()
if ClearOnExit == "yes" then
Online = {}
end
local ScriptStop=os.date("%I:%M %p  %m/%d/%y ")
local StopMsg = "Online Script Stopped"
Online[StopMsg] = ScriptStop
Save_File(OnlineFile,Online,"Online")
SaveOnline()
end

function NewUserConnected(user)
local Login=os.date("%I:%M %p  %m/%d/%y ")
    if Online[user.sName] == nil then
        Online[user.sName]= Login
        Save_File(OnlineFile,Online,"Online")
        SaveOnline()
    end
if ShowInfo ~= "yes" then
return 1
else
local Prof
local Topic
Prof= GetProfileName(user.iProfile) or "Unregistered User"
Topic = frmHub:GetHubTopic() or "There is no current topic."
local Mail = user.sEmail
if Mail == "" then Mail = "None" end
local art = string.rep("?",40).."\r\n"--??
local ul = string.rep("?",13).."\r\n"
local tmp = "\r\n\r\n\t"..art.."\tHub Information:\r\n\t"..ul..
"\tWelcome:\t"..user.sName..", "..Greeting.."\r\n"..
"\tHub Name: \t"..frmHub:GetHubName()..",  "..Topic.."\r\n"..
"\tHub description:\t"..frmHub:GetHubDescr().."\r\n"..
"\tHubOwner:\t"..HubOwner.."\r\n"..
"\tUptime:\t\t"..string.format("%.0f Minutes",frmHub:GetUpTime() / 60).."\r\n"..
"\tPeak Users:\t"..frmHub:GetMaxUsersPeak().."\r\n"..
"\tHub Share:\t"..string.format("%.2f Tb.",frmHub:GetCurrentShareAmount()/(1024 * 1024 * 1024 * 1024)).."\r\n"..
"\tThere Are Now:\t"..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." online.\r\n\r\n"..
"\t"..art.."\tYour Information:\r\n\t"..ul..
"\tUsername:\t"..user.sName.."\r\n"..
"\tIP Address:\t"..user.sIP.."\r\n"..
"\tShare Size:\t"..string.format("%.2f Gb.",user.iShareSize/(1024 * 1024 * 1024)).."\r\n"..
"\tProfile Name:\t"..Prof.."\r\n"..
"\tDC Tag:\t\t"..user.sTag.."\r\n"..
"\tDescription:\t"..user.sDescription.."\r\n"..
"\tEmail:\t\t"..Mail.."\r\n"..
"\tConnection:\t"..user.sConnection.."\r\n\r\n\t"..art..
"\t? [ This information is only being shown to you ] ?\r\n\r\n\t"..art
user:SendData(tmp)
end
end

OpConnected = NewUserConnected

function UserDisconnected(user,data)
    if Online[user.sName] ~= nil then
        Online[user.sName]= nil
        Save_File(OnlineFile,Online,"Online")
        SaveOnline()
    end
end

OpDisconnected = UserDisconnected

Save_Serialize = function(tTable, sTableName, hFile, sTab)
sTab = sTab or "";
hFile:write(sTab..sTableName.." = {\n" );
for key, value in tTable do
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
if(type(value) == "table") then
Save_Serialize(value, sKey, hFile, sTab.."\t");
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
hFile:write( sTab.."\t"..sKey.." = "..sValue);
end
hFile:write( ",\n");
end
hFile:write( sTab.."}");
end

Save_File = function(file,table , tablename )
local hFile = io.open (file , "w")
        if hFile then
      Save_Serialize(table, tablename, hFile);
      hFile:close()
        else
            hFile:write("")
        end
end

function SaveOnline()
    dofile(OnlineFile)
local File = io.open (OnlineFile2 , "w")
  if File then
      File:write("\\\\\\\")
      File:write("\\\
\\User Name\\\\    \\\\Login Time\\\\")
      for i,v in Online do
          File:write("\\
"..i.."\\    \\"..v.."\\")
      end
      File:write("\\\\")
          File:close()
   else
       File:write("")
  end
end


this works

there were only two " 's to remove ^^
Title:
Post by: Yello on 16 August, 2005, 13:37:13
can anyone help to street boy to fix the bugs in his script ? I realy need this script in the way i poste it !
Title:
Post by: Dessamator on 16 August, 2005, 14:34:43
disp = disp.." ? Description:

ur strings arent closed, whenever u use a string u must have a quotation  in the beggining and the end, e.g:
disp = disp.." ? Description: "
Title: another one...
Post by: ?Tr??T_???? on 16 August, 2005, 17:49:32
login = {
["BotName"] = "Info-Bot",
["Hubowner"] = "[']['?N]Azim",
["webadres"] = "ur web adress here",
["Forumadres"] = "http://www.jimenmickeclubforum.dyndns.info",
["minsharehub"] = "1 GB",
["helpcommand"] = "!help",
}
local kb = "1024"
local mb = kb*kb
local gb = mb*kb
local tb = gb*kb

function Main()
frmHub:RegBot(login.BotName)
end

function NewUserConnected(user)
Message(user)
end

function OpConnected(user)
Message(user)
end

--// Profile Counter
function ProfileCounter(profile)
local table, count = GetUsersByProfile(profile), 0
for i, User in table do
if GetItemByName(User) then
count = count + 1
end
end
return count
end

function Message(user)
local timeanddate = os.date("%d-%m-%Y %H:%M:%S")
local tmp = os.clock()
local weeks, days, hours, minutes, seconds = math.floor(tmp/604800), math.floor(math.mod(tmp/86400, 7)), math.floor(math.mod(tmp/3600, 24)), math.floor(math.mod(tmp/60, 60)), math.floor(math.mod(tmp/1, 60))
if frmHub:GetHubTopic() == nil then
topic = "No topic set"
else
topic = frmHub:GetHubTopic()
end
if user.sMyInfoString then
local disp = ""
doGetProfile = GetProfileName(user.iProfile) or "Not registerd (reg your self type !regme and a password of your choice in main)"
hubshare = string.format("%0.3f", frmHub:GetCurrentShareAmount()/(tb)).." TB"
local _,_,share = string.find(user.sMyInfoString, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $[^$]+[^$]%$[^$]*%$%s*(%d+)%$" )

if share then
minshare = string.format("%0.3f", tonumber(share)/gb).." GB"
else
minshare = "Corrupt"
end
border1 = " :::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?::: ?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:: :"
border2 = " :::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?::: ?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:: :"
userinfo = " ? User Information:"
hubinfo = "? Hub Information:"
disp = "\r\n\r\n"..border1.."\r\n"

disp = disp.." ? Hub Information:"
disp = disp.." ? Name: "..frmHub:GetHubName().."\r\n"
disp = disp.." ? Description: "..frmHub:GetHubDescr().."\r\n"
disp = disp.." ? Topic: "..topic.."\r\n"
disp = disp.." ? Hub Address: "..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n"
disp = disp.." ? Web Address: "..login.webadres.."\r\n"
disp = disp.." ? Shared: "..hubshare.."\r\n"
disp = disp.." ? Hubowner: "..login.Hubowner.."\r\n"
disp = disp.." ? Local Date And Time: "..timeanddate.."\r\n"
disp = disp.." ? There Are: "..ProfileCounter("NetFounder").." netfoudner(s),"..ProfileCounter("master").." Master(s),"..ProfileCounter("Operator").." Operator(s),"..ProfileCounter("Vip").." Vip(s),"..ProfileCounter("reg")..", Registered user(s).\r\n\r\n"
disp = disp.." ? User Information:"
disp = disp.." ? Nick: "..(user.sName or "n/a").."\r\n"
disp = disp.." ? IP Address: "..user.sIP.."\r\n"
disp = disp.." ? Share: "..minshare.."\r\n"
disp = disp.." ? Slots: "..user.iSlots.."\r\n"
disp = disp.." ? Description: "..(user.sDescription or "n/a").."\r\n"
disp = disp.." ? Connection: "..user.sConnection.."\r\n"
disp = disp.." ? E-Mail: "..user.sEmail.."\r\n"
disp = disp.." ? Profile Name: "..doGetProfile.."\r\n"
disp = disp.." :::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?::: ?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:: :"
user:SendData(login.BotName, disp)

disp = nil
end
end--------------------------------------------------------------------------------
Title: how it comes
Post by: ?Tr??T_???? on 16 August, 2005, 17:50:05


 :::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?::: ?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:: :
 ? Hub Information: ? Name: ']['h? ?impl? N?']['w?rK [UK]
 ? Description: mp3's; movies; games; etc...RCv10.01e
 ? Topic: Play Trivia and Jumble..Enjoy
 ? Hub Address: thesimplenetwork.mine.nu:411
 ? Web Address: ur web adress here
 ? Shared: 0.474 TB
 ? Hubowner: [']['?N]Azim
 ? Local Date And Time: 16-08-2005 16:47:43
 ? There Are: 1 netfoudner(s),1 Master(s),2 Operator(s),2 Vip(s),2, Registered user(s).

 ? User Information: ? Nick: [']['?N]Azim
 ? IP Address: 82.24.122.205
 ? Share: 10.739 GB
 ? Slots: 4
 ? Description: Hub Owner
 ? Connection: Cable
 ? E-Mail: thesimplenetwork@hotmail.co.uk
 ? Profile Name: NetFounder
 :::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?::: ?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:::?:: :
Title: missing and organization..
Post by: ?Tr??T_???? on 16 August, 2005, 17:54:12
Has u can c its missing some stuff:
? Uptime:
? Users:
? User Peak:
? Max User Peak:
? Country:
? Reliability:
? Rating:
? Tag:
? Flag:
? Your Local Date And Time Is:
? Client & Version:

and this is not well organized:
 ? Hub Information: ? Name: ']['h? ?impl? N?']['w?rK [UK]
? User Information: ? Nick: [']['?N]Azim
Title: LUA
Post by: ?Tr??T_???? on 16 August, 2005, 17:55:24
sorry m8 its like this coz i dont know lua language...
i just tried to make more easy to who will do it...
 ;)  ;)  ;)  ;)  ;)