hatter.ash - Tea anyone!?

slyz

Developer
When the "hatter" CLI command was added, the notes of the mad hatter effects were changed in statuseffects.txt, which broke this script.

I still use it because of the handy shortcuts (meat, ml, %spell etc...). If anyone else wants to use it, find this function:
PHP:
effect[int] hatter_effect_map(){
	effect[int]buffs;
	foreach num in hatter_effects(){
		matcher chars = create_matcher("(\\d+)", num.to_effect().note);
		chars.find();
		buffs[chars.group(1).to_int()] = num.to_effect();
	}
	return buffs;
}
and replace it with:
PHP:
effect[int] hatter_effect_map(){
	effect[int]buffs;
	foreach num in hatter_effects(){
		foreach str, b in num.to_effect().all{
			matcher chars = create_matcher("(\\d+)", str);
			chars.find();
			buffs[chars.group(1).to_int()] = num.to_effect();
			break;
		}
	}
	return buffs;
}
 

Theraze

Active member
Updated hatter.ash to no longer have $type[""] bits which make me sad.
 

Attachments

  • hatter.ash
    16.8 KB · Views: 108

seesee

New member
I'm new to scripting. I just want a super simple "visit the hatter and get the buff" script. so after I drink a potion, I try to run this script:

void main()
{
print("1");
visit_url("rabbithole.php?action=teaparty");
print("2");
visit_url("choice.php?pwd="+my_hash()+"&whichchoice=441&option=1");
print("end");
}

the line that doesn't work is: visit_url("rabbithole.php?action=teaparty"); it just hangs mafia until times out. What the heck is wrong with that line? Why won't it visit the hatter?

thanks guys,

seesee
 

seesee

New member
Yes. I run this script after drinking a potion. Eventually, I'd like to develop this script into more, but for now, I can't even make this ONE little line work for me, and it seems to be at the heart of most other Hatter scripts. so...I just don't understand it.
 

lostcalpolydude

Developer
Staff member
Looks like that URL hasn't worked for years, because KoL changed. Checking outside of a script quickly shows that you need place.php?whichplace=rabbithole.
 

seesee

New member
so are you saying I should write, visit_url("rabbithole.php?whichplace=rabbithole?action=teaparty"); I don't think I understand.
 

seesee

New member
oh..you mean. exactly that... visit_url("place.php?whichplace=rabbithole"); i see. but how to add in the action=teaparty ?
 

seesee

New member
i wrote, visit_url("place.php?whichplace=rabbithole?action=teaparty"); I'll have to wait till tomorrow to see if that works, 'cause I already visited the hatter today! but at least it didn't hang and it seems to at least run. thanks...I'll check it tomorrow.
 
Top