PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Genius on 10 April, 2005, 16:00:49

Title: Time bot
Post by: Genius on 10 April, 2005, 16:00:49
Hi evryone

Sory my bad inglish

I need a script for time um my Hub

exemple:

1:00  -?   bla bla bla
2:00 -?    ble ble ble

One reason for evry hour

[][]s Genius

Mp3-Tuga.sytes.net  Only portuguese users
Title:
Post by: Herodes on 10 April, 2005, 17:25:09
try this one ..
--- SayOnTime by Herodes v1
--- displays a msg when the hour changes.
--- request by genius

curHour = os.date("%H")

function ChatArrival( user, data )
---// Configure your Messages Here!
local tMessages = {
-- [hour] = { "nick", "msg" },
[0] = { "Hour", "The message" },
[1] = { "Hour", "The message" },
[2] = { "Hour", "The message" },
[3] = { "Hour", "The message" },
[4] = { "Hour", "The message" },
[5] = { "Hour", "The message" },
[6] = { "Hour", "The message" },
[7] = { "Hour", "The message" },
[8] = { "Hour", "The message" },
[9] = { "Hour", "The message" },
[10] = { "Hour", "The message" },
[11] = { "Hour", "The message" },
[12] = { "Hour", "The message" },
[13] = { "Hour", "The message" },
[14] = { "Hour", "The message" },
[15] = { "Hour", "The message" },
[16] = { "Hour", "The message" },
[17] = { "Hour", "The message" },
[18] = { "Hour", "The message" },
[19] = { "Hour", "The message" },
[20] = { "Hour", "The message" },
[21] = { "Hour", "The message" },
[22] = { "Hour", "The message" },
[23] = { "Hour", "The message" },
}

if curHour ~= os.date("%H") then
curHour = os.date("%H")
SendToAll( tMessages[tonumber(curHour)][1], tMessages[tonumber(curHour)][2])
end
end

NewUserConnected = ChatArrival
UserDisconnected = ChatArrival
OpConnected = ChatArrival
OpDisconnected = ChatArrival
MyInfoArrival = ChatArrival
SearchArrival = ChatArrival
Title:
Post by: Dessamator on 10 April, 2005, 17:45:33
QuoteOriginally posted by Herodes
NewUserConnected = ChatArrival
UserDisconnected = ChatArrival
OpConnected = ChatArrival
OpDisconnected = ChatArrival
MyInfoArrival = ChatArrival
SearchArrival = ChatArrival

hmmm interesting way to avoid using a timer,  :D , PS. i was confused ?(  at first, almost  thought u were crazy !!
Title:
Post by: Herodes on 10 April, 2005, 17:49:44
QuoteOriginally posted by Dessamator
QuoteOriginally posted by Herodes
NewUserConnected = ChatArrival
UserDisconnected = ChatArrival
OpConnected = ChatArrival
OpDisconnected = ChatArrival
MyInfoArrival = ChatArrival
SearchArrival = ChatArrival

hmmm interesting way to avoid using a timer,  :D , PS. i was confused ?(  at first, almost  thought u were crazy !!
original concept from UserCleaner by plop... that should explain the madness :D
Title:
Post by: Genius on 10 April, 2005, 18:44:56
Hi

The script have a error    :(


Syntax error: attempt to index global `os' (a nil value)
stack traceback:
   1:  main of file `...nte de trabalho\Mp3-World\scripts\??? Horas.lua' at line 5
Title:
Post by: Madman on 10 April, 2005, 18:53:36
Thats beacuse the script is written in lua5.. u need to update your ptokax for this script to work...

get the latest at //www.ptokax.org
Title:
Post by: Genius on 10 April, 2005, 19:23:17
Hi
Sory but i don?t go update my ptokax because in portugal have a client dc "PTDC++V2" and new version don?t acept.

I need this script for ptokax 15.25 :)

[][] Genius
Title:
Post by: Madman on 10 April, 2005, 20:14:00
that can be fixed...

start a test hub with 16.09 and add this to the file ClientTags.xml

   
        PTDC++V2
        PTDC
   


it should be over the last

and then try to enter your test hub

*edit*
 thats if the tag looks like this


but if it looks like this



it should look like this
   
        PTDC++
        PTDC
   



Hope it helps... =)
Title:
Post by: Genius on 10 April, 2005, 20:45:06
Hi

Have a problem, I?m update tag clients, don?t work, e tring a lot tag?s, and nothing

This is a exemple, user info


[20:06:18] *** Info on **** ***
 
Client:      CZDC/BCDC based client   [09-04 19:24]
Filelist generator:   
Lock:      EXTENDEDPROTOCOLABCABCABCABCABCABC
Pk:      DCPLUSPLUS0.305ABCABC
Tag:      <++ V:0.305,M:A,H:1/0/2,S:2>
Supports:      BZList MiniSlots GetTestZBlock  
Status:      Normal (1)
TestSUR:      File Not Available
Disconnects:   0
Timeouts:      0
Downspeed:   1.35 kB/s
IP:      *****
UserIP:      *****
Search port   26365
ISP:      
Known hubs:   1   ***(*****)  
Stated hubs:   3
Host:      *****
Description:   ?
Email:      
Connection:   Cable
Commands:   
Filelist size:   43.97 kB  (45029 B)
ListLen:      87.06 kB  (89147 B)
Stated Share:   13.10 GB  (14063846767 B)
Real Share:   13.10 GB  (14063846767 B)   [09-04 19:43]
Total files:   3909 (hashed: 0)
Percent hashed:   
Cheat status:   CZDC/BCDC based client
Comment:      
Logged In:   09-04 19:14 (0:51:42)
Title:
Post by: Herodes on 10 April, 2005, 20:49:42
madman tried to explain that you need to open the file named 'ClientTags.xml' that you can find inside the 'cfg' folder  of the latest PtokaX release, with Notepad.exe

After you do that please read what madman is telling in his post ...
Title:
Post by: Genius on 10 April, 2005, 21:29:34
Hi

Lot don?t working ok?
I think is PTDC, send bad my info, and no join, because tag is dc++0.305

But e request a time bot for ptokax 15.25, because i?m not use a new ptokax.

Please creat a bot for ptokax 15.25  :)

Sory my bad inglish

[][] Genius
Title:
Post by: ConejoDelMal on 10 April, 2005, 23:02:18
like genius said, the Tag of PTDC++ is the same as Dc++ 0.305, the only visible diference is the description, it has "Free Slots:3?" or just "" but I will test connecting with it to see if i can get more info

*edited*

Got this when connecting:
[23:32] (81.193.58.65) > $Supports UserCommand NoGetINFO NoHello UserIP2 |
[23:32] (81.193.58.65) > $Key ????A ????0?R??????1"sp??1?S?C??aq??|
[23:32] (81.193.58.65) > $ValidateNick norcy|
[23:32] norcy (81.193.58.65) > $Version 78551224731|
[23:32] norcy (81.193.58.65) > $GetNickList|
[23:32] norcy (81.193.58.65) > $MyINFO $ALL norcy ? faxo nepias!!!!?<++ V:0.305,M:A,H:5/4/1,S:3>$ $DSL$norcy_k023@hotmail.com$34749520462$|
[23:32] norcy (81.193.58.65) > $Version 78551224731|
[23:32] x User removed: norcy (Socket 856)

Any sugestions?
Title:
Post by: Herodes on 11 April, 2005, 00:01:21
$Version 78551224731| shitty ... that looks pretty bad to me .. normally this should read $Version 1,0091| Then it there is the mistake of sending the $Version again after having requested for a NickList and having sent a MyINFO!! That should be the reason Ptx gets this client disconn...

btw .. from the $Supports I figure that it is pretty back in time .. y do those hubs force you to use that client ? it looks quite shauvinists' behaviour... :(
Title:
Post by: Genius on 11 April, 2005, 01:01:22
And my script???

   :(  :(  :(  :(  :(  :(
Title:
Post by: Herodes on 11 April, 2005, 01:06:42
there is your script .. but really try and synchronise ( update your Ptx!!) cause I dont think that ppl around here are willing to continue writing scripts for older Ptxs ..
--- SayOnTime by Herodes v -1
--- displays a msg when the hour changes.
--- request by genius
--- for oooolllddd ptx...

curHour = date("%H")

function DataArrival( user, data )
---// Configure your Messages Here!
local tMessages = {
-- [hour] = { "nick", "msg" },
[0] = { "Hour", "The message" },
[1] = { "Hour", "The message" },
[2] = { "Hour", "The message" },
[3] = { "Hour", "The message" },
[4] = { "Hour", "The message" },
[5] = { "Hour", "The message" },
[6] = { "Hour", "The message" },
[7] = { "Hour", "The message" },
[8] = { "Hour", "The message" },
[9] = { "Hour", "The message" },
[10] = { "Hour", "The message" },
[11] = { "Hour", "The message" },
[12] = { "Hour", "The message" },
[13] = { "Hour", "The message" },
[14] = { "Hour", "The message" },
[15] = { "Hour", "The message" },
[16] = { "Hour", "The message" },
[17] = { "Hour", "The message" },
[18] = { "Hour", "The message" },
[19] = { "Hour", "The message" },
[20] = { "Hour", "The message" },
[21] = { "Hour", "The message" },
[22] = { "Hour", "The message" },
[23] = { "Hour", "The message" },
}

if curHour ~= date("%H") then
curHour = date("%H")
SendToAll( tMessages[tonumber(curHour)][1], tMessages[tonumber(curHour)][2])
end
end
Title:
Post by: Genius on 11 April, 2005, 01:12:41
Hi again :)

Sory but the script have errors :(



Syntax error: attempt to index global `os' (a nil value)
stack traceback:
   1:  function `DataArrival' at line 38 [file `...nte de trabalho\Mp3-World novo\scripts\hora.lua']
Title:
Post by: Herodes on 11 April, 2005, 01:16:35
QuoteOriginally posted by ?[-?Genius?-]?
Hi again :)

Sory but the script have errors :(



Syntax error: attempt to index global `os' (a nil value)
stack traceback:
   1:  function `DataArrival' at line 38 [file `...nte de trabalho\Mp3-World novo\scripts\hora.lua']

fixed .. re-copy pls..
Title:
Post by: ConejoDelMal on 11 April, 2005, 01:45:20
QuoteOriginally posted by Herodes
Then it there is the mistake of sending the $Version again after having requested for a NickList and having sent a MyINFO!! That should be the reason Ptx gets this client disconn...
Well, so maybe it wont be possible to get them in...
QuoteOriginally posted by Herodes
btw .. from the $Supports I figure that it is pretty back in time .. y do those hubs force you to use that client ? it looks quite shauvinists' behaviour... :(
yep, its old and dead i guess, and no, we do not force them to use this client, but a lot of people like to, and i dont want them to stay out when i change Ptokax...
Title:
Post by: Genius on 11 April, 2005, 01:57:23
hi again

the script don?t work :(
don?t have errors
No syntax errors in the script.
Title:
Post by: Herodes on 11 April, 2005, 02:00:57
QuoteOriginally posted by ?[-?Genius?-]?
hi again

the script don?t work :(
don?t have errors
No syntax errors in the script.
it hasn't been left running for an hour yet ..
Title:
Post by: Genius on 11 April, 2005, 02:04:30
the bot send this for main chat

  The message

don?t show the time
Title:
Post by: Psycho_Chihuahua on 11 April, 2005, 02:52:40
well you have to do something to  :D

you can edit to your choosing in this part of the script

Example:

[9] = { "Hour", "The message" },
where:

[9] is 9 oclock
"Hour" you can write like "9 O'clock"
"The message" here you enter the message you want to be shown at the set time
Title:
Post by: bastya_elvtars on 11 April, 2005, 03:09:36
QuoteOriginally posted by ?[-?Genius?-]?
the bot send this for main chat

  The message

don?t show the time

Enter /ts in mainchat and press Enter.