determinate determinate

Author Topic: Top Hubbers  (Read 14369 times)

0 Members and 3 Guests are viewing this topic.

Offline 6Marilyn6Manson6

  • Scripter
  • King
  • ******
  • Posts: 869
  • Karma: +47/-35
    • http://www.marilynmanson986.altervista.org
Re: Top Hubbers
« Reply #70 on: October 05, 2006, 12:33:03 am »
Code: [Select]
--## Simple Time Bot
--## Requested by SteffJay
--## Made by nErBoS
--## Converted in LUA 5 by 6Marilyn6Manson6
--## Commands:
--##   !time - Gives the current time

sBot = "Time-Bot"

function ChatArrival(user, data)
if (string.sub(data,1,1)=="<") or (string.sub(data,1,5+string.len(sBot))=="$To: "..sBot) then
data = string.sub(data,1,string.len(data)-1)
s,e,cmd = string.find(data,"%b<>%s+(%S+)")
if (cmd == "!time") then
user:SendData(sBot, GetTime())
end
end
end

function GetTime()
f = os.date("%p")
s = os.date("%S")
h = os.date("%l")
m = os.date("%M")
d = os.date("%d")
mm = os.date("%m")
y = os.date("%y")
Date = "Date: "..d.."/"..mm.."/20"..y.."   Time: "..h..":"..m..":"..s.."  "..f
return Date
end

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #71 on: October 05, 2006, 06:26:34 am »
hey 6M6M6 thx for the help, but ur script was showing me wrong time, for 9:52 AM it was showing 00:42 AM. I donno tht it is problem in script or frm side coz i was in a hurry, thn i tried Mutor's script, it is working well & btw wat is UTC mutor? and can u edit this script in such a way tht even if one user type's !time all shud be able to see command along with the result. Thank you
« Last Edit: November 05, 2006, 05:23:30 pm by speedX »
Thanking You,

speedX

Offline Thor

  • Scripter
  • Lord
  • ******
  • Posts: 292
  • Karma: +43/-5
    • Hungarian Direct Connect Site
Re: Top Hubbers
« Reply #72 on: October 05, 2006, 08:00:48 am »
http://ro.4242.hu/cgi-bin/yabb2/YaBB.pl?num=1159443959 ;D
hey 6M6M6 thx for the help.....but ur script was showing me wrong time.....for 9:52 AM it was showing 00:42 AM .......i donno tht it is problem in script or frm side coz i was in a hurry......
Maybe the server's clock didn't set up... Check it
May the force be with you



Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #73 on: October 07, 2006, 11:15:48 pm »
Hey jiten, this tophubbers doesnt give result if the nick is given in small. Like for BLITZKRIEG, if i type !hubtime blitzkrieg, it shows nick not found.
And one user in my hub had first logged in with nick ShEvChEnKo7 and thn later SHEVCHENKO7 so there has been a double entry for this guy.

Quote
0 month(s), 9 day(s), 11 hour(s), 21 minute(s)   10460 min   09/06/06 20:50:24   09/06/06 21:35:56   Cool Member   *Online*   SHEVCHENKO7
and

0 month(s), 7 day(s), 5 hour(s), 34 minute(s)   5122 min   09/23/06 07:44:01   09/23/06 07:42:06   Cool Member   *Online*   ShEvChEnKo7



so now wat to do ??

Posted on: 05 October 2006, 19:42:07
hey guys, this is urgent for me. Could ne one fix it for lower case also? plz
« Last Edit: November 05, 2006, 05:21:16 pm by speedX »
Thanking You,

speedX

Offline Psycho_Chihuahua

  • Systemspecialist IT
  • Administrator
  • Emperor
  • *****
  • Posts: 1 071
  • Karma: +112/-1
  • I am wherever i want to be
    • PtokaX Luaboard
Re: Top Hubbers
« Reply #74 on: October 07, 2006, 11:47:08 pm »
could.......you please........stop posting.........like this?
PtokaxWiki ¦PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: Top Hubbers
« Reply #75 on: October 15, 2006, 09:27:10 pm »
hey jiten.....this tophubbers doesnt give result if the nick is given in small......like for BLITZKRIEG if i type !hubtime blitzkrieg...it shows nick not found.....

and one user in my hub had first logged in with nick ShEvChEnKo7 and thn later SHEVCHENKO7 so there has been a double entry for this guy......

so now wat to do ??

I'd say that you'll have to use the exact nick when using the !hubtime command.

When a user changes his nick's case he must have a reason to do so, and in my point of view it should remain as a separate database entry.

You have to use the actual nick [case must match] else there are hub calls made and user objects used that might fail with improper case. Often it's fine to match in lower case. This is not one of those times.


Offline Creative

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +8/-3
Re: Top Hubbers
« Reply #76 on: October 20, 2006, 04:49:35 pm »
Jiten, wen i type !tophubbers or !myhubtime, i get the foll error:
Code: [Select]
scripts\tophub.lua:86: attempt to compare number with nil
Wats the problem???

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #77 on: October 27, 2006, 08:36:51 am »
Hey jiten, sorry but bugging u for the last time :P
Is it possible to only show the command to all not the output??
Thanking You,

speedX

Offline achiever

  • Lord
  • ***
  • Posts: 260
  • Karma: +25/-22
Re: Top Hubbers
« Reply #78 on: October 31, 2006, 11:47:50 am »
hi,

sir this script is giving me error
[16:06] Syntax D:\ptokax\scripts\TopHubbers2.01.lua:328: attempt to perform arithmetic on local `iSeconds' (a nil value)
n its not showing me right click menu
also not showing my average hubtime
n the average hubtime of others also is the same as their session time
eg
========================================
         Stats:
   --------------------------------------------------------------------------------
   - Nick: leon
   - Total uptime: 7 minute(s)
   - Daily average uptime: 7 minute(s)
   - Current Rank: Newbie

but this persons total hub time is 0 months, 0 days, 2 hours, 55 minutes   leon

plzz can u help me sort this out , as i have no idea of srcipting

thks,

achiever.
thks,
achiever.

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #79 on: November 05, 2006, 08:42:30 am »
Hey jiten,
this script is showing me the following error in Ptokax 0.3.5.2

Quote
[13:08] Syntax ...der\PtokaX DC Hub 0.3.5.2\scripts\TopHubbers2.01.lua:311: 'string.gfind' was renamed to 'string.gmatch'
Thanking You,

speedX

Offline -SkA-

  • Double Ace
  • *
  • Posts: 147
  • Karma: +24/-2
Re: Top Hubbers
« Reply #80 on: November 05, 2006, 09:33:01 am »
Hey jiten,
this script is showing me the following error in Ptokax 0.3.5.2


I'm using tophubbers (old version TopHubbers 1.21) with PX 0.3.5.2 and it's working fine, no errors.
« Last Edit: November 05, 2006, 09:36:59 am by -SkA- »
«««:::•€x†®em€-N€†•™:::»»» ØwN€®

BrianzaLand Blog" style="border:0

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #81 on: November 05, 2006, 10:12:49 am »
I'm using tophubbers (old version TopHubbers 1.21) with PX 0.3.5.2 and it's working fine, no errors.

But the version wich u r using, does it have all the commands of v2.01 ?? If yes thn plzz attach the script.
Thanking You,

speedX

Offline -SkA-

  • Double Ace
  • *
  • Posts: 147
  • Karma: +24/-2
Re: Top Hubbers
« Reply #82 on: November 05, 2006, 10:56:27 am »
But the version wich u r using, does it have all the commands of v2.01 ?? If yes thn plzz attach the script.

I really don't think so... I use that script only for !tophubbers command  ::)
«««:::•€x†®em€-N€†•™:::»»» ØwN€®

BrianzaLand Blog" style="border:0

Offline Naithif

  • Triple Ace
  • **
  • Posts: 200
  • Karma: +32/-13
Re: Top Hubbers
« Reply #83 on: November 05, 2006, 11:17:17 am »
Hey jiten,
this script is showing me the following error in Ptokax 0.3.5.2
Quote
[13:08] Syntax ...der\PtokaX DC Hub 0.3.5.2\scripts\TopHubbers2.01.lua:311: 'string.gfind' was renamed to 'string.gmatch'

Just search for the word 'string.gfind' in the line 311 and rename it to 'string.gmatch' :)

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #84 on: November 05, 2006, 02:46:42 pm »
Thank you dude, its working now.
« Last Edit: November 05, 2006, 04:33:11 pm by speedX »
Thanking You,

speedX

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: Top Hubbers
« Reply #85 on: November 07, 2006, 07:11:21 pm »
hi,

sir this script is giving me error
[16:06] Syntax D:\ptokax\scripts\TopHubbers2.01.lua:328: attempt to perform arithmetic on local `iSeconds' (a nil value)
n its not showing me right click menu
also not showing my average hubtime
n the average hubtime of others also is the same as their session time

Can you give me more details?

Are you using a previous Top Hubbers version's database?
If yes, you'll surely get several and different syntax errors.

Hey jiten,
this script is showing me the following error in Ptokax 0.3.5.2

I'll update the whole code as soon as possible and make the script compatible with:

Quote
Added: iLoginTime to userobject in lua.

Offline Creative

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +8/-3
Re: Top Hubbers
« Reply #86 on: November 09, 2006, 06:38:47 am »
hi jiten, wen i type !tophubbers the foll error comes:
Code: [Select]
TopHubbers2.01.lua:226: attempt to compare two nil values

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: Top Hubbers
« Reply #87 on: November 09, 2006, 10:08:35 am »
hi jiten, wen i type !tophubbers the foll error comes:
Code: [Select]
TopHubbers2.01.lua:226: attempt to compare two nil values

Seems like your TopHubbers' database is corrupt [probably due to an older table structure].

Please stop your script, delete it [tOnliners.tbl] and restart it again.

Offline Creative

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +8/-3
Re: Top Hubbers
« Reply #88 on: November 10, 2006, 05:55:21 am »
Well no doubt this script is gr8............. but i wd like some changes to be made....like,

1] For !myhubtime and for !hubtime <nick> is it possible to keep same command?? i mean if i type !hubtime it will show my hubtime and if i type !hubtime <nick> it will show tht nick's hubtime.
Is it possible to do this???

2] And also keeping the nicks case sensitive.........
like if there r 2 nicks, Darth_Vader and DARTH.
So if i type !hubtime darth_vader thn it will show  "Darth_Vader's" hubtime and if i type !hubtime darth thn it will show "DARTH's" hubtime.
Well I mean to say tht, in 2nd point thr will be two changes...........
i.e if the nick is in capital and if v type in small thn too it will show the output and if v type half nick thn too it will show the output...

Plz try to make this changes........ :)

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
TopHubbers 2.02 - LUA 5.0/5.1
« Reply #89 on: November 10, 2006, 05:47:47 pm »
First post has been updated with some changes in the package.

Best regards

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #90 on: November 10, 2006, 07:25:56 pm »
Hey jiten,
I am using this script frm a quiet a long time when there was no option for lower case, due to this 2-3 users in my hub have more than one account, so now wht shud I do??

Can you make a convertor or something wich will delete users having more than one account??plzz if possible or shud I delete thm manually? :P
Thanking You,

speedX

Offline Creative

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +8/-3
Re: Top Hubbers
« Reply #91 on: November 11, 2006, 06:59:13 am »
Jiten dude...... string.lower change is fine...... but it would be nice if u make 1 more change in it so that if a user types half the nick thn too it will show the output.
For example: I wanna c hubtime of a nick AdminsTrator........ and if i type +hubtime admins thn it will show the output........
I know u can make this change...... :D

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: Top Hubbers
« Reply #92 on: November 11, 2006, 03:48:05 pm »
Can you make a convertor or something wich will delete users having more than one account??plzz if possible or shud I delete thm manually? :P

As requested...

Code: (lua) [Select]
--[[

TopHubbers 2.01-2.02 DB Converter by jiten (11/11/2006)

Requested by: speedX

DESCRIPTION:

This converter will keep the oldest repeated entry in the DB and delete the others.

STEPS:

1. Place your old tOnliners.tbl under your scripts' folder;
2. Run this script and the new file "tOnliners(new).tbl" will appear in the same folder;
3. Backup your old DB (just in case) and rename the new one to the default format: tOnliners.tbl
4. And that's it!

]]--

-- File to convert
fConvert = "tOnliners.tbl"
-- Output file
fConverted = "tOnliners(new).tbl"

Main = function()
if loadfile(fConvert) then dofile(fConvert) end; local tConvert, tRemove = tOnline, {}
for i, v in pairs(tConvert) do
tRemove[string.lower(i)] = (tRemove[string.lower(i)] or {})
table.insert(tRemove[string.lower(i)], v.Julian); table.sort(tRemove[string.lower(i)])
while #tRemove[string.lower(i)] > 1 do
table.remove(tRemove[string.lower(i)], #tRemove[string.lower(i)])
end
end
for i, v in pairs(tConvert) do
if tRemove[string.lower(i)] then
if tRemove[string.lower(i)][1] < v.Julian then tConvert[i] = nil end
end
end
local hFile = io.open(fConverted, "w+") Serialize(tConvert, "tOnline", hFile); hFile:close()
end

Serialize = function(tTable, sTableName, hFile, sTab)
sTab = sTab or "";
hFile:write(sTab..sTableName.." = {\n");
for key, value in pairs(tTable) do
if (type(value) ~= "function") then
local sKey = (type(key) == "string") and string.format("[%q]", key) or string.format("[%d]", key);
if(type(value) == "table") then
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
end
hFile:write(sTab.."}");
end

Posted on: 11 November 2006, 10:55:23
For example: I wanna c hubtime of a nick AdminsTrator........ and if i type +hubtime admins thn it will show the output........

As previously stated, you must type the actual nick [note that now they aren't case-sensitive].

If not, this could lead to some confusion. That's why I don't think it should be added. I hope you understand.

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #93 on: November 11, 2006, 05:01:56 pm »
Thanx for the quick reply jiten ;)
But I'm facing one problem. After running the script a new .tbl is formed named "tOnliners(new).tbl" and after renaming it to "tOnliners.tbl" it doesnt work :(
Thanking You,

speedX

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: Top Hubbers
« Reply #94 on: November 11, 2006, 07:01:05 pm »
But I'm facing one problem. After running the script a new .tbl is formed named "tOnliners(new).tbl" and after renaming it to "tOnliners.tbl" it doesnt work :(

There was a small typo in the code. It should be ok now.

Best regards

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #95 on: November 11, 2006, 08:01:37 pm »
Working, thx jiten for ur help ;)
Thanking You,

speedX

Offline Creative

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +8/-3
Re: Top Hubbers
« Reply #96 on: November 15, 2006, 06:07:08 pm »
jiten, script is working fine, but if any1 types nick in small letters, for example....... +hubtime darth_vader and if his nick is DartH_VadeR thn output comes but "*** Error: No record found for 'darth_vader'!"  comes.......

Output is correct but tht error also comes at same time......

Offline achiever

  • Lord
  • ***
  • Posts: 260
  • Karma: +25/-22
Re: Top Hubbers
« Reply #97 on: November 15, 2006, 07:42:11 pm »
hi,

stop ur older script. i.e tophubber_v2.01 i suppose then it will work.
both the scripts 2.01 and 2.02 r working so u get error from 1st script, n output from 2nd.
jiten ur script roxxx ;)

bye,

achiever
thks,
achiever.

Offline Creative

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +8/-3
Re: Top Hubbers
« Reply #98 on: January 12, 2007, 06:33:52 am »
Happy New Year to all Users......... Well i was thinking if 1 more command be added in this script to check which user is online since when. I mean, if v use !uptime <nick> thn it will show just the total time since the user is online. and !hubtime <nick> will be the regular command........ is this poss??

Offline ninad_laud

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-2
Re: Top Hubbers
« Reply #99 on: January 24, 2007, 04:13:50 pm »
HI JITEN .... I AM NEW 2 THIS THING OF HUB.............CAN U PLZ POST ME THE COMPLETE HUBTIME SCRIPT WHICH CONTAINS ALL THE THING REQUESTED BY USERS IN ONE SINGLE SCRIPT...........AND IT SHULD BE ERROR FREE.....CAN U PLZZ POST IT IMM..... I AM W8ING FOR U REPLY
Don't type your posts ALL-CAPITAL!

Keep your sentences together. Think before you hit the "post" button!
--Herodes
« Last Edit: January 25, 2007, 08:45:24 am by Herodes »

Offline ninad_laud

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-2
Re: Top Hubbers
« Reply #100 on: February 09, 2007, 03:16:29 am »
the hubtime script do not show hubtime of other users
[14:24:08] !hubtime potter
[14:24:09] <PtokaX> *** Error: You are not allowed to use this command!
can u plzz tell me how edit this

Offline speedX

  • Lord
  • ***
  • Posts: 436
  • Karma: +57/-19
Re: Top Hubbers
« Reply #101 on: February 19, 2007, 06:03:21 pm »
hubtime's function should be like this:

Code: [Select]
fFunction = function(user, data)
-- Parse nick
local _,_, nick = string.find(data, "^%S+%s+(%S+)$")
-- Exists
if nick then
-- Return
SendToAll(user.sName, data)
BuildStats(user, nick)
else
user:SendMessage(tSettings.sBot, "*** Syntax Error: Type !hubtime <nick>")
end
end,

You'll also need to replace your BuildStats function with this one:

Code: [Select]
BuildStats = function(user, nick)
-- In DB
if tOnline[nick] then
-- Average uptime in days
local iAverage = os.difftime(os.time(os.date("!*t")), tOnline[nick].Julian)/(60*60*24)
if iAverage < 1 then iAverage = 1 end
-- Generate message
local sMsg = "\r\n\r\n\t"..string.rep("=", 40).."\r\n\t\t\tStats:\r\n\t"..
string.rep("-", 80).."\r\n\t- Nick: "..nick.."\r\n\t- Total uptime: "..
MinutesToTime(tOnline[nick].TotalTime, true).."\r\n\t- Daily average uptime: "..
MinutesToTime((tOnline[nick].TotalTime/iAverage), true).."\r\n\t- Current Rank: "..GetRank(nick).."\r\n"
-- Send stats
SendToAll(tSettings.sBot, sMsg)
else
user:SendMessage(tSettings.sBot, "*** Error: No record found for '"..nick.."'!")
end
end

Notice that with these changes, if you've enabled the 'bRankOnConnect' option, every user's mainchat will be flooded with connecting users' stats. So, be careful.

I had requested jiten edit the script such tht the command and output is seen by all, in the old version. So, he gave me the above the tables to replace.
But when I make the above changes in the latest tophubbers script(v2.02), thn the string.lower function does not work......
Could any of the scripters plzz help me to fix it.

Any help would appreciated
If you are confused abt my request thn plzz tel me....
« Last Edit: February 19, 2007, 06:47:49 pm by speedX »
Thanking You,

speedX

Offline Yahoo

  • Triple Ace
  • **
  • Posts: 225
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: Top Hubbers
« Reply #102 on: March 26, 2007, 04:13:09 pm »
is it possible to make a small change in the script when i type the command i get the message as follows
Nick: Yahoo -- THT: 8 day(s), 10 hour(s), 2 minute(s) -- AHT: 3 hour(s), 18 minute(s)    -- Current Rank: Amateur
can it be changed to something like this
Nick: potter -- THT: 1 week(s), 1 day(s), 10 hour(s), 2 minute(s) -- AHT: 3 hour(s), 18 minute(s)    -- Current Rank: Amateur
"BoRN FIGhTEr"

Offline Troubadour

  • Scripter
  • Lord
  • ******
  • Posts: 311
  • Karma: +6/-0
  • Be yourself, there are plenty others allready.....
    • Jeugdhonk
Re: Top Hubbers
« Reply #103 on: March 27, 2007, 04:16:02 pm »
Which to download for the finished bugfree version?
Can there be a link with the good version?
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

Offline Psycho_Chihuahua

  • Systemspecialist IT
  • Administrator
  • Emperor
  • *****
  • Posts: 1 071
  • Karma: +112/-1
  • I am wherever i want to be
    • PtokaX Luaboard
Re: Top Hubbers
« Reply #104 on: March 27, 2007, 04:28:17 pm »
I'm not sure which was the final one but i can attach the one i am using in my hub. Havent had any problems with it
PtokaxWiki ¦PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

 

determinate determinate
guestbook