Twilight Forums

Idle chat for wannabe heroes
It is currently Sun May 19, 2013 4:31 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 353 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9  Next
Author Message
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:12 pm 
Offline
User avatar

Joined: Mon Dec 17, 2007 8:24 pm
Posts: 1234
Location: Baton Rouge, LA
I'm assuming the 100HP variable can be edited?

_________________
Image
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:14 pm 
Offline

Joined: Mon Nov 19, 2007 6:29 pm
Posts: 1773
Location: Florida
Yeah, if you know where to look in the script. Personally, I recommend changing the scheme to check for falling below a certain percentage, it's what the PFEBot and PHPBot do. But meh.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:15 pm 
Offline
User avatar

Joined: Mon Dec 17, 2007 8:24 pm
Posts: 1234
Location: Baton Rouge, LA
Complicated to make the variable an entry field in one's profile?

I made the changes from 100 to 300 below... hopefully, I didn't screw anything up:

Code:
var imageTD = find('.//img[@border="3"]/..');
GM_setValue('chicken',300);
if (imageTD) {
   var victory = /Victory!/;
   var loss = / /;
   var last = find('./*[last()]',imageTD);
   var weWon = victory.exec(document.body.innerHTML);
   var advTable = document.createElement("table");
   var advRow = document.createElement("tr");
   var advCell = document.createElement("td");
   var buttontype= null;
   var displayRound = null;
   var aCoward = GM_getValue('chicken',10);
   var yous = GM_getValue('health',300);
   if (endOfTurn()) {
      GM_setValue('turnsLeft',GM_getValue('turnsLeft',0)-1);
      if (yous<aCoward) shutDown();
      var round = GM_getValue('roundNumber',-1)+1;
      displayRound= round;
      GM_setValue('roundNumber', -1);
      if (GM_getValue('running',false)&&(GM_getValue('turnsLeft',false) > 0)){

_________________
Image
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:20 pm 
Offline

Joined: Mon Nov 19, 2007 6:29 pm
Posts: 1773
Location: Florida
Change the value in GM_setValue('chicken',100):
Code:
   GM_setValue('health',x[0]);}
else{

var imageTD = find('.//img[@border="3"]/..');
GM_setValue('chicken',100);
if (imageTD) {

from 100 to whatever you want.

EDIT: Yeah, you got it.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:22 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Well, I could probably strip out the part of chathazzar's scripts that do that... but those parts make up almost half of the scripts. (In other words, it's not easy.)
And I could also change it to a fractional approach. I just put up something that was a proof of concept, more than a finished product.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:30 pm 
Offline
User avatar

Joined: Sun Apr 08, 2007 1:01 am
Posts: 4228
Location: the Conservatory with the lead pipe
Eh. If I was to use chicken protection, I'd base it on my current HP, not a percentage. Especially since it might vary from zone to zone (100 HP would be fine for the pit, 600-800 for Insanity). No sense in hyperinflating the script just to switch to percentage.

_________________
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:31 pm 
Offline
User avatar

Joined: Mon Dec 17, 2007 8:24 pm
Posts: 1234
Location: Baton Rouge, LA
I changed 100 to 300 in TWO places (see above) was this incorrect?

Doc, if it's that big a deal, don't worry about it, bro.

_________________
Image
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:34 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Yeah, well, in the gets, it doesn't matter. Those are just default values that are used if the data is corrupted somehow. They don't really matter. (In other words, you did more than you had to.)


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:34 pm 
Offline

Joined: Mon Nov 19, 2007 6:29 pm
Posts: 1773
Location: Florida
(switch to percentage is as simple as getting one more value from the nav pane and then dividing the first by the second)

I see your point, but HP left needs to be changed according to the zone anyways. It'd really be best to allow the player to set it for each individual run somehow.

Also, CS, the second 100 you changed was changing a default value, but since you already set it, it doesn't matter. It's not necessary, but it doesn't hurt anything.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 3:51 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
actually, I already had both values. (current and max HP) I was just referring to making the changes in the script.

That said.. I'm gonna be busy for a couple hours, but I have an idea... I'll just add an entry field to the 'battle comp' which will take the threshold value for each run. But I don't have time to implement it atm.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 8:23 pm 
Offline
User avatar

Joined: Mon Dec 17, 2007 8:24 pm
Posts: 1234
Location: Baton Rouge, LA
Well, Doc... it didn't work. I set it for 300HP. I got to 285, and it kept going... when I stopped it and healed, it stopped working. No longer attacks.

_________________
Image
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Oct 29, 2009 11:37 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Odd. It's working for me. Sorta. (The crypts will usually kill, no matter what. But they do stop it under the conditions I mentioned.)
You might need to reset the number of turns manually, though. (It does drop it to 0 if you win during the round it realizes it should be stopping.)


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Fri Oct 30, 2009 4:14 am 
Offline
User avatar

Joined: Mon Dec 17, 2007 8:24 pm
Posts: 1234
Location: Baton Rouge, LA
Anyway way I can get a link to the old version so it's usable?

_________________
Image
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Fri Oct 30, 2009 8:15 am 
Offline
User avatar

Joined: Thu Oct 01, 2009 10:49 am
Posts: 451
Location: Florida, USA
Wow, you got to love Twilight Heroes. Fun, reliable, educational.
Oh yeah, I'm learning a lot from you guys!
Rock on!
:o 8) :o

_________________
When you do the best you can it's called a try!
If you don't you need to ask yourself why?
Just give it a thought,
And failure is worth naught.
And then like an eagle you shall fly!
Image


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Fri Oct 30, 2009 1:09 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
http://userscripts.org/scripts/version/ ... 82.user.js

That should be the right link... if not, userscripts does have a link on any script to check older versions of scripts...


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Fri Oct 30, 2009 11:10 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Oh. Minor note: I figured out why the chicken option was working on my copy of the a-a script and not others'... my nav-pane script was changing the location of the HP information on my system. I'll look into modifying it so that it doesn't require that, but in the mean time, unless you want to run both scripts, the old version of the a-a script is the only real option.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Sat Oct 31, 2009 1:17 am 
Offline

Joined: Mon Nov 19, 2007 6:29 pm
Posts: 1773
Location: Florida
Gasp! If you used my method and regex'd the content of the frame... :p


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Sat Oct 31, 2009 9:38 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
Doc Igor wrote:
Er, yeah. I updated it after I'd posted to incorporate my own css, because someone in chat had wanted to see what the nav pane was supposed to look like with it. And I try to eliminate all red-values from color schemes... it lets me stare at a computer screen a lot longer without headaches that way.
So, yeah... it affects more than just that one pane, now.

Well, I'd like to use your script, but I don't want to change the color for the forums. Any chance of that?


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Sat Oct 31, 2009 9:55 am 
Offline

Joined: Mon Nov 19, 2007 6:29 pm
Posts: 1773
Location: Florida
It's really quite easy. All she/you needs to do is put an exclude on "http://www.twilightheroes.com/forums/*". You can do that yourself, if you want to. Just right-click the GM symbol, click manage user scripts, select the auto-adventure script on the side, then click add next to the exclude section, and type that up there (minus the "") into the box. And you're done!


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Sat Oct 31, 2009 3:23 pm 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
Thanks Satan

Edit: I just realized that it does this awful coloring to all other pages as well. I guess I'll just wait till the author makes a script that does just one thing.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Sat Oct 31, 2009 4:40 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Well, like I mentioned elsewhere, the only way I could get around the fact that the nav pane text was disappearing when I'd relocated it was by including a css revamp. And, being lazy, I used a userstyle script to generate that. And since the style I was using was meant to fix[1] all the pages...

[1] That is, take out the red, so the screen is easier to look at for hours on end.

However, I'm working on modifying the a-a script so it doesn't need the nav pane script to work. And to include a few upgrades at the same time.

edit: for those who can't wait, the script should now perform as mentioned, without needing the nav-pane fix. I'll work on the other part and get it updated as possible.

re-edit: I've posted an experimental update... it's being tested. More news when it's available.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Mon Nov 02, 2009 7:51 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
I've been getting some confusing reports as to the current state of the autoadventure script. While I've had no issues running it in its current version, some people are stating that it is not working for them. If people are using it, and it's running properly (as it has on multiple systems I've run it on) that would be a nice confirmation, but anyone who tries it and finds it not work I ask to give details.
I know that the wiki script somehow breaks it, and (in the current version) it requires that it be run before any script modifying the nav pane. I suspect that the firebug extension can also break it (I haven't tested to confirm this, but firebug modifies the HTML that greasemonkey sees.) Likewise, any extensions that result in modifying the HTML will possibly break the script.

Specifically, if anyone is having serious problems with the script, the most useful information for me to diagnose would be obtainable through the following process:
1. call up the javascript console.
2. clear the messages
3. switch to showing errors only
4. attempt to adventure.
5. post the error message that appears in the console in a followup to this post.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Tue Nov 03, 2009 1:57 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
Works perfectly for me once I turn off all other scripts, and specifically the wikification script.
I did not install the nav script due to the color changes, but I guess my health is always high enough so I didn't encounter any problem.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Tue Nov 03, 2009 2:32 pm 
Offline

Joined: Sat Dec 29, 2007 12:42 am
Posts: 548
I think I found part of the problem - holding off posting anything until I can confirm.

_________________
==
insert clever .sig file here
==


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Tue Nov 03, 2009 9:23 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
It's been suggested that the common thread among those who couldn't get the script to work is that they were using twilightheroes.com instead of www.twilightheroes.com as they should be. I've modified the script to account for that, so we'll see if that works.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Wed Nov 04, 2009 1:32 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
Suggestion: when you get the out of MP message, stop. I was using Bovine Charge and left the chair for a second. It banged the server for quite some time before I returned.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Sun Nov 08, 2009 8:55 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
Add support for Aio, Quantitas Magna Frumentorum Est?

I added
Code:
   nonComChoice["Aio, Quantitas Magna Frumentorum Est"+"choice"] = "2";
   nonComChoice["Aio, Quantitas Magna Frumentorum Est"+"submitvalue"] = "What do you do?";


Here's the source:

Code:
<HTML><head><link rel='stylesheet' href='includes/style.css'><script type='text/javascript'>if (self.location == top.location)
top.location.href = 'index2.php';</script><script language=Javascript src='http://www.twilightheroes.com/scripts/popup.js'></script></head><BODY>
<table border=0 cellspacing=0 cellpadding=4 width='100%'><tr valign=top><td width='100%'><h2>Aio, Quantitas Magna Frumentorum Est</h2><font class='text'>

You dive off to the side as one out the outbuildings explodes in a ball of fire. It seems these Pax Verde operatives are more about the Macto Rutilus than the Pax Verde. As the heat wave washes over you, you find yourself pondering the use of Latin by various organizations around the world. You wonder if it really sounds as impressive as everyone seems to think it does. Perhaps you should call yourself a Crepusculum Vir.<P>

Your reverie (reverie? No, wait... that's French) is interrupted as you hear someone calling for help. While you're looking for the source of the voice, you notice another Pax Verde agent slinking towards another building. Hey, wait a minute! That's The Mad Bomber Wot Bombs At Midnight! You could probably catch the bomber unawares and bludgeon him from behind. On the other hand, that worker really needs your help. Man... silly Latin phrases were more fun to ponder.<P><form action=fight.php method=post><input type=radio name=choice value='1' checked>Rescue the worker<BR><input type=radio name=choice value='2'>Grab that bomber!<BR><BR><input type=submit value='What do you do?'></form>


</td><td align=center><img src='images/foes/explosion.jpg' height=200 width=200 border=3><BR><b></b></td></tr></table><script type='text/javascript'>top.nav.location='nav.php';</script>

</font>

</BODY>
</HTML>


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Mon Nov 09, 2009 7:04 am 
Offline

Joined: Sun Jul 05, 2009 9:11 pm
Posts: 174
does the new auto adv know about the pegasus adv? will it pick it automatically?


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Mon Nov 09, 2009 10:41 am 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
The answer to that is... it should. I've never done a dedicated pegasus hunt since modifying the script. Earlier versions failed because of Ryme being tricksy with choice option numbers (at least, the one I had it encounter - the cube one - didn't work right) so I changed the code to something that should work. Unfortunately, I've not had a fourth wall or pegasus option since implementing it, so I can't guarantee... especially if Ryme was especially tricksy in coding those adventures.
Again, a major factor here is that - since I haven't gotten the adventures/their source code, I can't be entirely certain that the current script will work flawlessly. If people get those encounters, grab the source and post it.

edit: I've updated the script to include the adventure Muh mentioned. I'm currently working on getting the new content adventure included, as well. I just need to get it, or the source.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Mon Nov 09, 2009 1:52 pm 
Offline

Joined: Sun Jul 05, 2009 9:11 pm
Posts: 174
would it be possible to get something that keeps a log of the advs to check? if I don't get a pegasus, it could just mean I didn't get the adv...


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Mon Nov 09, 2009 2:12 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Um... ok, I just have to turn edit a few things to do that.

I'll test it out some beforehand, but what'll happen is that it _should_ come up in the console messages. Unfortunately... I don't know how long the buffer on the console is.

Of course, there's another problem there... Ryme was pretty tricksy about those adventures. There isn't a different name for adventures when the fourth option is present, so seeing how many times the base adventure came up is no indication of the fourth option being present.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Tue Nov 10, 2009 10:42 am 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Oh, and because I was asked to, I've posted the version of the autoadventure script that I currently use. I was holding off on that, because I'd modified another script to make things simpler to use with this one... but...

If anyone is interested, I've posted it as a branch in the auto-adventure line... ie: it's a separate script on userscripts, with none of the history of the old version. It requires, as I mentioned, a slightly modified version of chathazzar's HP/PP status bar script, which I've also posted. The two of them (for anyone who wants to try this new version) are:
http://userscripts.org/scripts/show/61618 and http://userscripts.org/scripts/show/61617


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Tue Nov 10, 2009 10:06 pm 
Offline
User avatar

Joined: Mon Oct 27, 2008 11:13 pm
Posts: 1034
Location: RP Channel... we have cake!!
Doc.. the high-priority script is not working for me, is there something I can do to fix that?

_________________
Image
Top 10 on the Total Post list


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Tue Nov 10, 2009 10:44 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Hmm... try making it the first script to run? I'm just guessing here, since I don't have access to enough information.
What, precisely, is going wrong? What scripts are you running? What error messages are you getting?
(For the record, the sequence I have scripts running is: a-a v3.0, h-p nav, [assorted that don't interact in any way], HPbar)
So, with more info, maybe I can help.

Oh, one other thought... did you remember to type www. before twilightheroes.com?


In other news, there's a new script in development that was requested. I call it 'lilbuff', and it's available at http://userscripts.org/scripts/show/61752
It's still developmental, as it's pretty damn near impossible for me to test, as I don't have the items it's designed for. So there's minimal testing I can do. Anyone who's willing to try it and supply meaningful feedback (like error messages, or specific information about your installation and other scripts) is more than welcome.

edit: actually, I've recently been testing it... and the script is pretty FUBAR. I'm gonna take a break, see if maybe I'm overlooking something obvious when I come back to it.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Wed Nov 18, 2009 2:14 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
I've added a new script, this time as a result of multiple requests both in chat, and on the forums. The 'check/delete all' script is now available here.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Nov 19, 2009 1:00 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
My very first, extremely simple yet useful to me, script.

It auto-enters the chat when you log-in, saving you one (1) click per login.

http://userscripts.org/scripts/show/62333


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Thu Nov 19, 2009 6:30 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
And my second script. I guess I got appetite from the first one :)

This will add a link for direct access to your MD to your top pane.

http://userscripts.org/scripts/show/62370

It currently does not handle the case where you don't have a MD. I might handle this special case later, but I'm not sure it's worth the extra server hit.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Mon Nov 23, 2009 2:08 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
Muhandes wrote:
My very first, extremely simple yet useful to me, script.

It auto-enters the chat when you log-in, saving you one (1) click per login.

http://userscripts.org/scripts/show/62333

I updated the script so it now does a /day as soon as it enters the chat, potentially saving you an additional 5 keyboard clicks!


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Mon Nov 23, 2009 3:23 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
To help one of my testing multis, I have modified sounos's link to the radiation lab/sickbay to link to the hospital/enlightenment center instead if you don't have access to the space station yet.

If anyone is interested in this let me know and I will upload it.


Top
 Profile  
 
 Post subject: Re: Greasemonkey
PostPosted: Fri Nov 27, 2009 9:31 pm 
Offline

Joined: Sat Aug 08, 2009 4:43 pm
Posts: 501
Minor note: the recent change to the nav pane seems to have broken the old HP/PP status script. I've got my version of it working, so anyone who's upset at that script being broken can use it. Find it here.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 353 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group