egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

warn script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Aug 31, 2014 4:52 pm    Post subject: warn script Reply with quote

I want to create a warn script

!warn nickname time
time = can be hours/days/weeks/months etc

The script is almost finished i just dont know a way to script the part when that warning expires. I cant use timer because i want the bot to know where it remained after restart (and i dont think i can do that with timer) and i cant use bind time because it wont match the expiration date because i would probably use !warn command a specific second and bind time only acts at 00. So my question is how can i make that expiration date/unixtime match. How to save it and how to check it so i can remove it when it matches.
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sun Aug 31, 2014 5:54 pm    Post subject: Re: warn script Reply with quote

Madalin wrote:

...
i want the bot to know where it remained after restart
...


Some here might advise you to use a database. MySQL. I have never tackled that.

If you wish to have something intact after a restart, then you are going to have to write it disk.
The other way, is to write it a plain text file.

http://forum.egghelp.org/viewtopic.php?t=6885

Quite a bit of manipulation of records can be done. How cumbersome it becomes is a matter of how much info per record, and how many records.

I don't fully understand exactly what you want to do yet.
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Aug 31, 2014 7:01 pm    Post subject: Reply with quote

I have no problem in handleing file... i want to know whats the best way to save that record and match it later to see if it expired or not
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sun Aug 31, 2014 7:28 pm    Post subject: Reply with quote

Madalin wrote:

...
i want to know whats the best way to save that record and match it later to see if it expired or not


What comes to mind is : unixtime

If you can get the user to carefully input the date/time info, then you can use:
clock scan
on it to convert it to unixtime

Once you have it in that format, it is a matter of simple math to compare it to the current time.


I hope this helps.
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Aug 31, 2014 7:33 pm    Post subject: Reply with quote

I have been using [clock scan [unixtime] +2 days] for example ... but if i use bind time after to check if that $var is the same it wont be because bind time is every minute at 00 second.. so it wont match thats my problem
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sun Aug 31, 2014 7:37 pm    Post subject: Reply with quote

Madalin wrote:

...
so it wont match thats my problem


To discern if it is expired, won't it only be necessary to see if the time is passed?
In other words, why does it have to match? Can't you just test for
greater than
or
less than
depending on how you go about it.
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Aug 31, 2014 8:14 pm    Post subject: Reply with quote

Yeah... greater than should be enough.. Very Happy my bad then. Was fixed to match that exactly..

I often try to make something in the most complex way possible Smile so that later (weeks/months/years) find different ways to do the same but easier maybe just because TCLScripting is just a hobby Very Happy

Thanks for that simple idea Smile
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sun Aug 31, 2014 8:19 pm    Post subject: Reply with quote

You almost had me convinced that I just was not understanding what you needed. Smile

Good luck with it.
Let us know how it turns out.
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Aug 31, 2014 8:20 pm    Post subject: Reply with quote

As i said the script is done .. i had that problem of "matching" the date exactly ...but now everything is clear Smile) script is done
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sun Aug 31, 2014 8:25 pm    Post subject: Reply with quote

Madalin wrote:

...
script is done


That was quick!

Good to hear it.

Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber