Magic Resistance

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
jonnybmac
Posts: 3
Joined: 2012-02-15 16:00:14

Magic Resistance

Post by jonnybmac »

Hello, I am trying to raise magery and though it best to do my resistance first and finish off with magery if I need to once I GM resistance. Me and my friend are wanting to spar at the same time therefore I am trying to modify a resistance script to work with each other.

I've tried inputting the lines

Repeat
UO.DeleteJournal()
While NOT UO.InJournal("In Por Ylem")
Wait(200)


into the script so that if my target is casting magic arrow, I will wait until he is done before I start to cast my sequence.
Maybe im doing it wrong casting until out of mana? Maybe we should just cast one at a time, meditate then go again?

What I would like is for the script to understand that my target is casting magic arrow and wait until he has finished his 10-12 casts before I cast mine and vice versa.

Many thanks

Original Script
sub main()
var target='0x001A34CD'
var chest='0x40328B45'
uo.useobject(chest)
wait(1000)
while 1
while uo.mana > 10
if uo.bp<5 then
uo.findtype('0x0F7A',-1,chest)
if uo.findcount() then
uo.moveitem('finditem','50','backpack')
checklag()
wait(600)
endif
endif
if uo.ns<5 then
uo.findtype('0x0F88',-1,chest)
if uo.findcount() then
uo.moveitem('finditem','50','backpack')
checklag()
wait(600)
endif
endif
checklag()
uo.cast('Magic Arrow',target)
WaitForMana()
wend
if uo.mana < 10 then
meditation()
endif
wend
endsub
sub checklag()
repeat
UO.DeleteJournal()
UO.Click('backpack')
until backpack()==1
endsub
sub backpack()
var n
for n=0 to 200
if uo.injournal('a backpack') then
return 1
endif
wait(200)
next
endsub
sub meditation()
uo.findtype('0x0F0E','0x09DF','backpack')
if uo.findcount() then
uo.useobject('finditem')
wait(700)
else
while uo.mana < uo.int
if uo.Journal(0)=='You are preoccupied with thoughts of battle.' then
uo.warmode(0)
endif
checklag()
Uo.Useskill('Meditation')
waitformed()
wend
endif
endsub
sub waitformed()
var n
for n=0 to 100
if uo.injournal('You lose|at peace') then
return
endif
wait(500)
next
endsub
Sub WaitForMana()
VAR w,m=uo.mana
for w=0 to 100
if uo.mana<m then
return
endif
wait(200)
next
endsub



Edited Script
sub main()
uo.addobject('target')
while uo.targeting()
wait(4000)
wend
uo.addobject('chest')
while uo.targeting()
wait(4000)
wend
uo.useobject('chest')
wait(1000)
while 1
while uo.mana > 10
if uo.bp<5 then
uo.findtype('0x0F7A',-1,'chest')
if uo.findcount() then
uo.moveitem('finditem','50','backpack')
checklag()
wait(600)
endif
endif
if uo.ns<5 then
uo.findtype('0x0F88',-1,'chest')
if uo.findcount() then
uo.moveitem('finditem','50','backpack')
checklag()
wait(600)
endif
endif
Repeat
UO.DeleteJournal()
While NOT UO.InJournal("In Por Ylem")
Wait(200)
checklag()
uo.cast('Magic Arrow','target')
WaitForMana()
wend
if uo.mana < 10 then
meditation()
endif
wend
endsub
sub checklag()
repeat
UO.DeleteJournal()
UO.Click('backpack')
until backpack()==1
endsub
sub backpack()
var n
for n=0 to 200
if uo.injournal('a backpack') then
return 1
endif
wait(200)
next
endsub
sub meditation()
uo.findtype('0x0F0E','0x09DF','backpack')
if uo.findcount() then
uo.useobject('finditem')
wait(700)
else
while uo.mana < uo.int
if uo.Journal(0)=='You are preoccupied with thoughts of battle.' then
uo.warmode(0)
endif
checklag()
Uo.Useskill('Meditation')
waitformed()
wend
endif
endsub
sub waitformed()
var n
for n=0 to 100
if uo.injournal('You lose|at peace') then
return
endif
wait(500)
next
endsub
Sub WaitForMana()
VAR w,m=uo.mana
for w=0 to 100
if uo.mana<m then
return
endif
wait(200)
next
endsub
ZeroDX
Posts: 718
Joined: 2006-12-08 10:51:50
Location: Москва
Contact:

Re: Magic Resistance

Post by ZeroDX »

Code: Select all

sub main()
    uo.addobject('target')
    while uo.targeting()
        wait(4000)
    wend
    uo.addobject('chest')
    while uo.targeting()
        wait(4000)
    wend
    uo.useobject('chest')
    wait(1000)
    uo.deletejournal()
    if uo.getserial('self') > uo.getserial('target') then
        repeat
            wait(100)
        until uo.injournal('next')
        uo.deletejournal()
    endif
    while 1
        if uo.mana > 10 then
            if uo.bp<5 then
                uo.findtype('0x0F7A',-1,'chest')
                if uo.findcount() then
                    uo.moveitem('finditem','50','backpack')
                    checklag()
                    wait(600)
                endif
            endif
            if uo.ns<5 then
                uo.findtype('0x0F88',-1,'chest')
                if uo.findcount() then
                    uo.moveitem('finditem','50','backpack')
                    checklag()
                    wait(600)
                endif
            endif
            UO.DeleteJournal()
            While NOT UO.InJournal("In Por Ylem")
                Wait(200)
                checklag()
                uo.cast('Magic Arrow','target')
                WaitForMana()
            wend
        else
            uo.say('next')
            uo.deletejournal()
            repeat
                wait(100)
            until uo.injournal('next')
            meditation()
        endif
    wend
endsub
sub checklag()
    repeat
        UO.DeleteJournal()
        UO.Click('backpack')
    until backpack()==1
endsub
sub backpack()
    var n
    for n=0 to 200
        if uo.injournal('a backpack') then
            return 1
        endif
        wait(200)
    next
endsub
sub meditation()
    uo.findtype('0x0F0E','0x09DF','backpack')
    if uo.findcount() then
        uo.useobject('finditem')
        wait(700)
    else
        while uo.mana < uo.int
            if uo.Journal(0)=='You are preoccupied with thoughts of battle.' then
                uo.warmode(0)
            endif
            checklag()
            Uo.Useskill('Meditation')
            waitformed()
        wend
    endif
endsub
sub waitformed()
    var n
    for n=0 to 100
        if uo.injournal('You lose|at peace') then
            return
        endif
        wait(500)
    next
endsub
Sub WaitForMana()
    VAR w,m=uo.mana
    for w=0 to 100
        if uo.mana<m then
            return
        endif
        wait(200)
    next
endsub
Last edited by ZeroDX on 2012-02-15 17:15:16, edited 1 time in total.
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Re: Magic Resistance

Post by Nmy »

There's no need to cast magic for both of you. One of you should cast until your friends magic resistance is 100 then other one does the same thing.
jonnybmac
Posts: 3
Joined: 2012-02-15 16:00:14

Re: Magic Resistance

Post by jonnybmac »

Wont we save time doing it both at the same time though?
jonnybmac
Posts: 3
Joined: 2012-02-15 16:00:14

Re: Magic Resistance

Post by jonnybmac »

What about:

I cast spell magic arrow until mana < 10
uo.say 'done' - other client reads the done and starts his cycle
i start meditating through his spam
once his cycle is complete he then says done and i proceed to repeat mine whilst he meditates
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Re: Magic Resistance

Post by Nmy »

If attacking you won't stop meditation, then yes, you would save some of the time. Otherwise it's the same.
uo.msg('stop/go') thats what i would do
Post Reply