PDA

View Full Version : Looking for a simple casting script



Anebriated
07-24-2009, 02:48 PM
Im looking for a basic script that just checks to see if i have enough mana to cast 302 and then casts at a target. Trying to get my feet wet with lich scripting and figure this should be a good place to start.

Deathravin
07-24-2009, 02:58 PM
I usually just make a macro...

F1 = \x;eq fput "incant 701" if checkmana(1)\r
F2 = \x;eq fput "incant 702" if checkmana(2)\r

etc etc

Anebriated
07-24-2009, 02:59 PM
thats all it is? really? thats awesome.

Deathravin
07-24-2009, 03:02 PM
actually it would be the corrected one above... forgot the \x and \r

Anebriated
07-24-2009, 03:03 PM
well what about channeling a spell? im looking to use this for smite/bane.

Deathravin
07-24-2009, 03:11 PM
I started off making a SF script that used Lich...


match zero [exec1: the answer is 0]
match one [exec1: the answer is 1]
match two [exec1: the answer is 2]
put ;eq echo "the answer is #{rand(3)}"
matchwait
for things like dodging arrows in the rogue guild...

Then I converted existing scripts to the Lich-esque wizard language...


thingtodo = nil

start:
match "gotorand", "master footpad fires an arrow at you"
match "theend", "master foodpad tells you you're done", "you duck", "you jump", "you lean left"
fput thingtodo
matchwait

gotorand:
goto "label#{rand(3)}"

label0:
thingtodo = "jump"
goto "start"

label1:
thingtodo = "lean left"
goto "start"

label2:
thingtodo = "duck"
goto "start"

Then I made them fully lich, taking all the legacy code out

Anebriated
07-24-2009, 03:12 PM
thats awesome. Ive been trying to figure out ways to cross lich and SF/wiz scripting and that post helps out a lot. Thanks!

Deathravin
07-24-2009, 03:14 PM
well what about channeling a spell? im looking to use this for smite/bane.

I have no idea how smite/bane works... do you have to prep it first? is that the deal?

F1 = \x;eq if checkmana(2) ; put "prep 302" ; put "channel target" ; else ; respond "not enough mana" ; end\r

Anebriated
07-24-2009, 03:23 PM
yeah its just prep/channel.

Is there a way to check if the mob is dead before you cast?

btw that works great, thanks.

R>;eq if checkmana(2) ; put "prep 302" ; put "channel wraith" ; end
[exec1]>prep 302
[exec1]>channel wraith
You chant a reverent litany, clasping your hands while focusing upon the Smite spell...
Your spell is ready.
>
You channel at a wraith.
A scintillating, blue-white aura encompasses a wraith.
CS: +96 - TD: +45 + CvA: +25 + d100: +65 == +141
Warding failed!
With a sudden burst of divine insight, you're able to amplify the power of your Smite spell!
An explosion of blue-white energy near a wraith consumes the surrounding area with a blinding light.
The wraith is hit for 50 points of damage!
... 20 points of damage!
A fine strike pins the right leg for an instant.
The wraith looks miffed.
It is knocked to the ground!
Cast Roundtime 3 Seconds.
Roundtime: 3 sec.

Anebriated
07-24-2009, 04:09 PM
just threw this together and i think its working fairly well. but im doing something wrong as its not releasing the spell when I dont have a target.


spell=variable[1]

put "incant #{spell}" if checkmana(3)
loop{
line = get
if line =~/Cast Roundtime/
exit
elseif line =~/You do not currently have a target./
put "rel"
exit
elseif line =~/Your armor prevents the spell/
put "incant #{spell}"
end

}


>;c 302
--- Lich: c active.
[c]>incant 302
You chant a reverent litany, clasping your hands while focusing upon the Smite spell...
Your spell is ready.
You gesture at a lesser frost shade.
A scintillating, blue-white aura encompasses a lesser frost shade.
CS: +96 - TD: +6 + CvA: +20 + d100: +78 == +188
Warding failed!
Multiple rays of blue-white energy ignite several patches of a lesser frost shade's skin in a blaze of energy.
The frost shade is hit for 45 points of damage!
The frost shade falls to the ground motionless.
Cast Roundtime 3 Seconds.
>
--- Lich: c has exited.
>;c 302
--- Lich: c active.
[c]>incant 302
You chant a reverent litany, clasping your hands while focusing upon the Smite spell...
Your spell is ready.
[/b]You do not currently have a target.[/b]
>
You feel at full magical power again.
>rel
You feel the magic of your spell rush away from you.

Bhuryn
07-24-2009, 04:14 PM
Isn't there a flag to always channel on incant if possible and then just incant it?

Anebriated
07-24-2009, 04:16 PM
Isn't there a flag to always channel on incant if possible and then just incant it?

ChannelIncant OFF Do not channel incanted spells.

good call.

Joseph
07-25-2009, 02:57 AM
try taking a look at voodoo.lic, you could easily modify it using the def waggle portion of waggle.lic to make it more inline with what you are wanting.

Deathravin
07-25-2009, 03:04 AM
\x;eq if checkmana(2) and GameObj.npcs.find { |npizzle| npizzle.status != "dead" } ; put "prep 302" ; put "channel target" ; else ; respond "not enough mana or no living critters" ; end\r

I think that's about what were looking for there... Anything more I think we're into real script territory...

And I'm not sure you need to change "target" to your actual target... you can do channel target, and it will target whatever's in the room.

Anebriated
07-25-2009, 07:22 PM
yeah Im looking to actually make it a script. I want to learn the language so I figure this is a nice easy way to get into it. Ive been staring at the code of a few different scripts and its not exactly uniform which makes it rather difficult.