Page 3 of 29 FirstFirst 1 2 3 4 5 13 ... LastLast
Results 21 to 30 of 284

Thread: missingManuel.ash - Yet Another Manuel Script!

  1. #21
    Senior Member Erich's Avatar
    Join Date
    Jul 2010
    Posts
    358

    Default

    And delete La

  2. #22

    Default

    Version 1.2 is uploaded. Removes the extra Slimes and Eds, and fixes issues with acute letters and the articles in Muertos Borrachos.

    How do I make the script check if there is a newer version available?

  3. #23
    Senior Member
    Join Date
    Sep 2006
    Posts
    322

    Default


    How do I make the script check if there is a newer version available?
    Originally Posted by Turing View Post
    Plagerize, plagerize, plagerize! Let no one else's work evade your eyes! Just be sure to call it research.

    Seriously, look at one of the scripts that do it, and "adapt" the code to your ends.

  4. #24
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,164

    Default

    How do I make the script check if there is a newer version available?
    Originally Posted by Turing View Post
    Most people just use zlib and don't worry about the specifics. Basically though the trick is to visit_url() on the thread to read in the current version number. Here's the non-zlib version of update checking that I use for Universal Recovery, although it does steal heavily from zlib.

    Code:
    string thisver = "3.10.6";
    
    string check_version() {
    	string soft = "Universal Recovery";
    	string prop = "_version_BalesUniversalRecovery";
    	int thread = 1780;
    	int w; string page;
    	boolean sameornewer(string local, string server) {
    		if (local == server) return true;
    		string[int] loc = split_string(local,"\\.");
    		string[int] ser = split_string(server,"\\.");
    		for i from 0 to max(count(loc)-1,count(ser)-1) {
    			if (i+1 > count(loc)) return false;
    			if (i+1 > count(ser)) return true;
    			if (loc[i].to_int() < ser[i].to_int()) return false;
    			if (loc[i].to_int() > ser[i].to_int()) return true;
    		}
    		return local == server;
    	}
    	switch(get_property(prop)) {
    	case thisver: return "";
    	case "":
    		print("Checking for updates (running "+soft+" ver. "+thisver+")...");
    		page = visit_url("http://kolmafia.us/showthread.php?t="+thread);
    		matcher find_ver = create_matcher("<b>"+soft+" (.+?)</b>",page);
    		if (!find_ver.find()) {
    			print("Unable to load current version info.", "red");
    			set_property(prop,thisver);
    			return "";
    		}
    		w=19;
    		set_property(prop,find_ver.group(1));
    		default:
    		if(sameornewer(thisver,get_property(prop))) {
    			set_property(prop,thisver);
    			print("You have a current version of "+soft+".");
    			return "";
    		}
    		string msg = "<big><font color=red><b>New Version of "+soft+" Available: "+get_property(prop)+"</b></font></big>"+
    		"<br><a href='http://kolmafia.us/showthread.php?t="+thread+"' target='_blank'><u>Upgrade from "+thisver+" to "+get_property(prop)+" here!</u></a><br>"+
    		"<small>Think you are getting this message in error?  Force a re-check by typing \"set "+prop+" =\" in the CLI.</small><br>";
    		find_ver = create_matcher("\\[requires revision (.+?)\\]",page);
    		if (find_ver.find() && find_ver.group(1).to_int() > get_revision())
    		msg += " (Note: you will also need to <a href='http://builds.kolmafia.us/' target='_blank'>update mafia to r"+find_ver.group(1)+" or higher</a> to use this update.)";
    		print_html(msg);
    		if(w > 0) wait(w);
    		return "<div class='versioninfo'>"+msg+"</div>";
    	}
    	return "";
    }
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  5. #25
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    D.C. suburbs of Virginia, USA
    Posts
    3,666

    Default

    Code fragments for a zlib example...

    Code:
    import <zlib.ash>;
    ...
    string THIS_VERSION = "1.4";
    string THIS_NAME = "DCQuest";
    int THIS_THREAD = 3640;
    ....
    	check_version(THIS_NAME,"DCQuest",THIS_VERSION,THIS_THREAD);
    ....
    Note that this is looking for a thread on kolmafia.us and checking the first post.

    In this case it is looking for
    DCQuest 1.4
    which I think reduces to string matching on THIS_VERSION and THIS_NAME withing Bold tags, but I have been copying and pasting for so long I don't remember exactly the difference between the first and second parameters.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post
    There are 69 players more powerful than you.
    Originally Posted by Statistics Leaderboards

  6. #26

    Default

    Version 1.3 is up. Now with version checking (thanks, Bale). Grey goos are now grouped. Rene C. Corman is back with a vengeance. Different versions of gremlins, nightstands, protector spirits, and clingy pirates are now recognized.

    Issues with Ninja snowmen and Vibrato monsters are pending, but the groundwork is laid out to fix them soon.

  7. #27

    Default

    And now Version 1.4 is up, with ninja snowmen and translated Vibrato monsters. It should now be reporting correctly all 989 monsters. As always, let me know if you find a bug, or if there's some improvement or feature you'd like to see.

    Edit: Just noticed I put Corman in the Bugbear Invasion area, rather than the Zombie Slayer area. I'll have that fixed for the next version.
    Last edited by Turing; 11-27-2012 at 03:12 PM.

  8. #28
    Senior Member
    Join Date
    Apr 2006
    Posts
    132

    Default

    just noticed the 2 versions of the lonely construct are exactly the same including factoids. ugh jick

  9. #29
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,164

    Default

    just noticed the 2 versions of the lonely construct are exactly the same including factoids. ugh jick
    Originally Posted by charred View Post
    That's true? I saw it on the wiki and assumed it was an error. You verified that in your own Manuel? Weird.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  10. #30
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,833

    Default

    So report it as a KoL bug. They might fix it.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

Similar Threads

  1. New Content - Implemented Manuel got some new tricks.
    By Erich in forum Bug Reports
    Replies: 38
    Last Post: 05-07-2013, 08:34 AM
  2. Replies: 0
    Last Post: 01-31-2013, 06:40 PM
  3. New Content - Implemented More Manuel Items
    By Bale in forum Bug Reports
    Replies: 11
    Last Post: 11-25-2012, 05:47 AM
  4. Monster Manuel checker
    By ckb in forum Informational Scripts
    Replies: 11
    Last Post: 10-21-2012, 03:40 AM
  5. New Content - Implemented Monster Manuel
    By Erich in forum Bug Reports
    Replies: 50
    Last Post: 09-22-2012, 06:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •