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 

Auto update script

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


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

PostPosted: Fri Feb 08, 2013 7:00 pm    Post subject: Auto update script Reply with quote

I want to know what the best way to auto update a script. I want to create a script like this. I want to get all my scripts work with this meaning that all my scripts could auto update themselfs (or manually).

I was thinking at something like this:

Script
1. The script itself will check a page on a domain for the script version (if the version is other) the script will wget the new file and remove the old one (or make a backup of it)
2. The bot will rehash/restart depending on the modification

Website
1. Every tcl script will have a folder or its own (.tcl and .info). The script will check the .info file and see if the script was updated or not
2. For the public scripts i will want to make a specific file so that every public script will contain a specified KEY (if key is invalid he wont be able to wget the file) if its valid he will

For the public scripts i think a manually command would be better than an automated proc

The part with they key i think it would be harder Very Happy yet i posted anyway. If anyone has any other ideas on how to make this pelase reply.[/b]
_________________
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
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Fri Feb 08, 2013 7:42 pm    Post subject: Re: Auto update script Reply with quote

Madalin wrote:
I want to know what the best way to auto update a script.
Using the ETag or Last-Modified field within the reply header is easier. You wont need to read a page body, aka [::http::data] which means less bandwidth to check when an update is required...
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Madalin
Master


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

PostPosted: Fri Feb 08, 2013 7:46 pm    Post subject: Reply with quote

I don`t think that was the problem because making a simple .txt page with a number (the version) and making the bot read that wouldnt make the bot take to much bandwith. The think was if the my idea on how to update a script is the best way or not. If does steps are correct or i need another plan
_________________
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
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Fri Feb 08, 2013 8:14 pm    Post subject: Reply with quote

Then go with clumsy. Those fields I mention are there for exactly the purpose you describe. To not use them is illogical.

Quote:
!webby http://ereader.kiczek.com/scripts/autogoogle.tcl
> No Title ( http://is.gd/gS8eHs )( 200; application/x-tcl; iso8859-1; 6934 bytes )( 1y, 1h, 48m, 16s ago )

!webby http://ereader.kiczek.com/scripts/incith-fml.tcl
> No Title ( http://is.gd/RDbagE )( 200; application/x-tcl; iso8859-1; 26975 bytes )( 4w, 1d, 3h, 50m, 51s ago )


I can tell very simply how old my scripts are on my site. Simple is best.


To do what you want is easy:
<for the main script>
Download the new script as somescript.new.tcl
Rename current version of the script as somescript.old.tcl
(If somescript.old.tcl exists before the rename, delete it before you rename.)
Now rename the new script from somescript.new.tcl to somescript.tcl

<for the config>
Make sure the config is something like: somescript.config.tcl
In the main script, source somescript.config.tcl

Now you can easily auto-update the script without bothering the user that you've ever done anything. Magic. Their config is never touched. Their settings remain the same.

Incith-google has an easter-egg (unexplained feature) that does this. You put settings you change from defaults in a file called "incith-google-settings.tcl". Any variables set in there are sourced after it creates the defaults. Thereby over-riding those defaults with custom values. It's all quite simple in design.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
SmasHinG
Voice


Joined: 29 Aug 2011
Posts: 29

PostPosted: Sat Feb 09, 2013 3:52 am    Post subject: Reply with quote

And here is the question how to get setting from old tcl to import in new tcl Smile
Madalin your idea is great but this think you want to auto update okay but setting for every tcl how to change from old tcl to new Smile That`s the big problem of your idea Smile
_________________
SmasHinG®
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 -> Script Requests 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