Yoko

All sides of Injection
It is currently 2024-04-18 11:54:53

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Magic Resistance
PostPosted: 2012-02-15 16:06:42 
Offline

Joined: 2012-02-15 16:00:14
Posts: 3
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

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


Top
   
 Post subject: Re: Magic Resistance
PostPosted: 2012-02-15 17:12:46 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Code:
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.

Top
   
 Post subject: Re: Magic Resistance
PostPosted: 2012-02-15 17:13:14 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
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.

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject: Re: Magic Resistance
PostPosted: 2012-02-15 17:17:39 
Offline

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


Top
   
 Post subject: Re: Magic Resistance
PostPosted: 2012-02-15 17:22:30 
Offline

Joined: 2012-02-15 16:00:14
Posts: 3
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


Top
   
 Post subject: Re: Magic Resistance
PostPosted: 2012-02-15 17:37:11 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
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

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: Google [Bot] and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited