Page 8 of 9

Re: Greasemonkey

Posted: Thu Oct 29, 2009 3:12 pm
by Corrupt Shadow
I'm assuming the 100HP variable can be edited?

Re: Greasemonkey

Posted: Thu Oct 29, 2009 3:14 pm
by Satan
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.

Re: Greasemonkey

Posted: Thu Oct 29, 2009 3:15 pm
by Corrupt Shadow
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: Select all

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)){

Re: Greasemonkey

Posted: Thu Oct 29, 2009 3:20 pm
by Satan
Change the value in GM_setValue('chicken',100):

Code: Select all

	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.

Re: Greasemonkey

Posted: Thu Oct 29, 2009 3:30 pm
by Cristiona
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.

Re: Greasemonkey

Posted: Thu Oct 29, 2009 3:31 pm
by Corrupt Shadow
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.

Re: Greasemonkey

Posted: Thu Oct 29, 2009 3:34 pm
by Satan
(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.

Re: Greasemonkey

Posted: Thu Oct 29, 2009 8:23 pm
by Corrupt Shadow
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.

Re: Greasemonkey

Posted: Fri Oct 30, 2009 4:14 am
by Corrupt Shadow
Anyway way I can get a link to the old version so it's usable?

Re: Greasemonkey

Posted: Fri Oct 30, 2009 8:15 am
by AldenteVonTino
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

Re: Greasemonkey

Posted: Sat Oct 31, 2009 1:17 am
by Satan
Gasp! If you used my method and regex'd the content of the frame... :p

Re: Greasemonkey

Posted: Sat Oct 31, 2009 9:38 am
by Muhandes
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?

Re: Greasemonkey

Posted: Sat Oct 31, 2009 9:55 am
by Satan
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!

Re: Greasemonkey

Posted: Sat Oct 31, 2009 3:23 pm
by Muhandes
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.

Re: Greasemonkey

Posted: Tue Nov 03, 2009 1:57 am
by Muhandes
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.

Re: Greasemonkey

Posted: Tue Nov 03, 2009 2:32 pm
by malk-a-mite
I think I found part of the problem - holding off posting anything until I can confirm.

Re: Greasemonkey

Posted: Wed Nov 04, 2009 1:32 am
by Muhandes
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.

Re: Greasemonkey

Posted: Sun Nov 08, 2009 8:55 am
by Muhandes
Add support for Aio, Quantitas Magna Frumentorum Est?

I added

Code: Select all

	nonComChoice["Aio, Quantitas Magna Frumentorum Est"+"choice"] = "2";
	nonComChoice["Aio, Quantitas Magna Frumentorum Est"+"submitvalue"] = "What do you do?"; 
Here's the source:

Code: Select all

<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>

Re: Greasemonkey

Posted: Tue Nov 10, 2009 10:06 pm
by Carygon Nijax
Doc.. the high-priority script is not working for me, is there something I can do to fix that?

Re: Greasemonkey

Posted: Thu Nov 19, 2009 1:00 am
by Muhandes
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

Re: Greasemonkey

Posted: Thu Nov 19, 2009 6:30 am
by Muhandes
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.

Re: Greasemonkey

Posted: Mon Nov 23, 2009 2:08 am
by Muhandes
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!

Re: Greasemonkey

Posted: Mon Nov 23, 2009 3:23 am
by Muhandes
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.