PDA

View Full Version : New to lich ultrahunt question



Hemloch
08-11-2009, 03:51 AM
I'm a total n00b to lich I have heard about the ultrahunt script what exactly does it do and how does it work?

Joseph
08-11-2009, 09:09 AM
READ it!

SpiffyJr
08-11-2009, 11:06 AM
I wrote it. It hunts, stance dances, and can be used anywhere in the game that Lich has mapped (just about everything). It's a semi-advanced script and requires some knowledge to get it working. I wrote it for myself but released it to show what type of scripting Lich can do. Don't expect too much help from me with it.

eeky
08-11-2009, 04:19 PM
I think I can figure most of this out except how to setup the attacking part. Not sure how to enter the info or set it up for casting.

Hemloch
08-11-2009, 06:09 PM
I think I can figure most of this out except how to setup the attacking part. Not sure how to enter the info or set it up for casting.

Yah, for us that aren't scripting masters, we don;t quite understand everything. I am trying very hard to learn, and have found the best way to do that is to ask questions.

Anebriated
08-11-2009, 06:15 PM
Yah, for us that aren't scripting masters, we don;t quite understand everything. I am trying very hard to learn, and have found the best way to do that is to ask questions.

The best way to learn is to start of easy. Taking a hunting script written by someone who is very good with the language is definitely not the easiest way. Find a simple casting script or something and go from there.

Not to mention most people arent the most eager to share/give out hunting scripts.

Hemloch
08-11-2009, 06:29 PM
The best way to learn is to start of easy. Taking a hunting script written by someone who is very good with the language is definitely not the easiest way. Find a simple casting script or something and go from there.

Not to mention most people arent the most eager to share/give out hunting scripts.

Thank you for the reply, isn't there a tutorial of some sorts within lich? I guess I need to download notepad ++ to view them, I'm trying!

SpiffyJr
08-11-2009, 09:00 PM
The best way to learn is to start of easy. Taking a hunting script written by someone who is very good with the language is definitely not the easiest way. Find a simple casting script or something and go from there.

Not to mention most people arent the most eager to share/give out hunting scripts.

^^ This. I program for a living so some of what I do may not make sense to someone with little to no programming experience. Most of what I write has more complex concepts because I try to make my scripts as versatile as possible. I would start with a few simple scripts like a) a buy script, b) foraging script, c) a deed script. Start with little scripts that use will use often to get a feel for the language. When you are comfortable with the general syntax start moving on to more advanced features.

Anebriated
08-12-2009, 12:06 AM
a few scripts to get you started... pretty basic conversion from wizFE scripting...

http://forum.gsplayers.com/showthread.php?t=45309

Hemloch
08-12-2009, 03:44 AM
thanks for all your help.

Flessen
08-21-2009, 01:47 PM
Have a question. I am attempting to customize this further but failing. LOL

Here is the original code:

$XP_READY_TO_HUNT = 4


loop {
deathCheck();
standCheck();

case checkarea
when Settings[Char.name]["restArea"]
echo "Resting"
if (checkmind $XP_READY_TO_HUNT)
# Cooldown
echo "*** STATUS - Mind full, resting 60 seconds" if $DEBUG_MODE;
$timeout = 61;
sleep 60;
else
# Ready to hunt
doLocation(Settings[Char.name]["restOut"])
doGoto("hunt")
end
when Settings[Char.name]["huntArea"]
if !checkfried and (health? > checkhealth*0.50)
# Check our spells
checkSpells()

# Walk until we find a critter by itself, then kill it
$timeout = $TIMEOUT_DURATION
until walk
line = script.gets
echo "*** STATUS - Walk returning "+line.to_s if $DEBUG_MODE

if $stormfront
waitfor("Obvious [A-z]+:")
sleep 0.15
end
checkSpells()
#$timeout = $TIMEOUT_DURATION
end

As this stands it hunts until it gets to muddled then rests. (It also doesn't ask to be healed or goes to the bank as it is.

Now I am trying to edit it so it will stop hunting at a certain point.


loop {
deathCheck();
standCheck();

case checkarea
when Settings[Char.name]["restArea"]
echo "Resting"
if (checkmind $XP_READY_TO_HUNT)
# Cooldown
echo "*** STATUS - Mind full, resting 60 seconds" if $DEBUG_MODE;
$timeout = 61;
sleep 60;
else
# Ready to hunt
doLocation(Settings[Char.name]["restOut"])
doGoto("hunt")
end
when Settings[Char.name]["huntArea"]
if ((!checkfried < checkmind(5)) and (health? > checkhealth*0.50))
# Check our spells
checkSpells()

# Walk until we find a critter by itself, then kill it
$timeout = $TIMEOUT_DURATION
until walk
line = script.gets
echo "*** STATUS - Walk returning "+line.to_s if $DEBUG_MODE

if $stormfront
waitfor("Obvious [A-z]+:")
sleep 0.15
end
checkSpells()
#$timeout = $TIMEOUT_DURATION
end

I am trying to find the proper commands but unlike the old lich this one didn't have those with the installation itself. So I don't even know if I'm using the right syntax.

Any insight is appreciated.

Tillmen
08-22-2009, 01:07 PM
I think you want

if percenthealth(50) and not checkmind(7)

checkmind(7) will only return true if you're fried or saturated. For the most part, the old documentation at http://lichproject.sourceforge.net/api.xml still applies. It's missing the new stuff like GameObj, checkencumbrance, checkbounty, etc.. A couple things that only worked in the Wizard before, now don't work at all, like survivedisease?, survivepoision?, and checkreallybleeding. Most things have been fixed or improved, but used in the same way as before.

pabstblueribbon
08-22-2009, 01:31 PM
if !checkfried and (health? > checkhealth*0.50)

This line says if we are NOT fried and our health is greater than 50% execute this block.

This part of the script has nothing to do with telling it when to go home.

I think you're looking in the wrong area, but I havent opened the script. The next line's logic is completely wrong.

if ((!checkfried < checkmind(5)) and (health? > checkhealth*0.50))

This line doesnt make sense, I dont know how not being fried (!checkfried returns true if you are not fried) could be less than checkmind(5) which only returns a true or false value.

checkmind however, will return an integer. If you ever want to know what a function will return as, simply type ;e echo function

Oh and uh. I honestly wouldnt use ultrahunt. Its nice and all but if you really want to learn I'd find a basic hunting script, like fireguardians.lic and try to figure out what its doing and add to it/ask questions on lnet.

Tillmen
08-22-2009, 03:08 PM
(health? > checkhealth*0.50)

health? and checkhealth are actually the same thing. This is similar to:

checkhealth > checkhealth*0.50

If you don't want to use percenthealth, you'll have to stick a maxhealth in there somewhere.

Flessen
08-22-2009, 03:45 PM
I actually found a way it worked....(so far)


while !checkfried
if (health? > checkhealth*0.50)
# Check our spells
checkSpells()

before it was refusing to get fried before resting...it would get muddled (checkmind(4)) then rest...

so I switched to above....

actually trying to figure out what the heck it was doing...caused me to read up more on some ruby tutorials.

I will have to play around with the percenthealth. Thank you both for helping.