Yoko

All sides of Injection
It is currently 2025-11-23 01:46:06

All times are UTC+02:00




Post new topic  Reply to topic  [ 16 posts ] 
Author Message
 Post subject: Delay time
PostPosted: 2010-01-06 17:27:50 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
Hi russian ppl, im a brasilian and i´m desenvolving a script to automatic cast spells with a dinamic wait(), its more or less like this

Code:
inicio:
UO.Cast('Flame Strike','laststatus') ;cast poison
         while true
            if uo.injournal("visao|frizzle") then ; if is out of sight
               goto inicio
            else
               while true
                  [b]if not uo.injournal("HERE IS MY PROBLEM") then ; i dont know what to put to verify if the FS actualy not was sucessfull, so if not it will do the while again till it damages the oponent
                     wait(100)
                  else
                     if uo.injournal("HERE IS MY PROBLEM") then ;if the damage was sucessfull breaks the loop[/b]
                     return false
                     endif
                  endif
               wend
            endif
            return false ;break the loop
         wend



help me plz


Top
   
 Post subject:
PostPosted: 2010-01-06 18:22:49 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Why use a goto?
You can use the gethp('ID') like this.
Code:
if uo.GetHP(OBJ)<>uo.GetMAXHP(OBJ) then

If I understood correctly. :roll:

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
 Post subject:
PostPosted: 2010-01-06 18:25:53 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
OBJ would be my target?

Code:
inicio:
UO.Cast('Flame Strike','laststatus') ;cast poison
         var targetlife = uo.gethp('lasttarget')
         while true
            if uo.injournal("visao|frizzle") then ; if is out of sight
               goto inicio
            else
               while true
                  [b]if not uo.gethp('laststatus') <> targetlife then
                     wait(100)
                  else
                     if uo.gethp('laststatus') <> targetlife then
                     return false
                     endif
                  endif
               wend
            endif
            return false ;break the loop
         wend


like this?

but that dont work with magic that dont land damage like paralize i would like something more general to work with all magics if possible. ty


Top
   
 Post subject:
PostPosted: 2010-01-06 18:56:39 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Code:
sub fstarget()
   var m
   repeat
      repeat
         checklag()
         m=uo.mana
         if uo.mana < 22 then
            uo.print('no mana')
            return
         endif
         uo.cast('Flame Strike','laststatus')
         wait(600)
      until not uo.injournal('Target is not in line of sight')
      repeat
         wait(100)
      until uo.mana<m
   until not uo.injournal('The spell fizzles')
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

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


Top
   
 Post subject:
PostPosted: 2010-01-06 19:17:14 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
you got it Nmy, MANA CHECK, PERFECT!!!!

TY.


Top
   
 Post subject:
PostPosted: 2010-01-06 20:15:40 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
this is my medium to finish script well the quotes is still needing debug, javascript:emoticon(':?')

Code:
Sub Delay()
   var mana = uo.mana
   while true
      if uo.injournal("visao|frizzle") then ; out of sight
         return false
      else
         while true
            if uo.mana == mana then ;if the spell didnt land
               wait(100)
            else
               if uo.mana < mana then ;if the spell land
                  return false
               endif
            endif
         wend
      endif
      return false ;brake loop
   wend
endsub



; not my pasted from the Nmys Code
sub checklag()
   repeat
      UO.DeleteJournal()
      UO.Click('backpack')
   until backpack()==1
endsub


; not my pasted from the Nmys Code
sub backpack()
   var n
   for n=0 to 200
      if uo.injournal('a backpack') then
         return 1
      endif
           wait(200)
        next
endsub




sub Poisoned()
   wait(500)
   repeat ; cure till poison efect is off
      checklife()
      uo.warmode(0)
      uo.waittargetself()
      uo.cast('Cure')
      wait(3000)
   until not uo.poisoned('self')
endsub




Sub checklife()
      repeat
         if uo.life <= 50 then ; check  the life is to low, then use total mana pots
               uo.usetype(0x0E21) ; <- the type of the mana pots is wrong
            wait(500)
           else
              uo.waittargetself()
              uo.usetype(0x0E21) ; <- the type of the bandages is wrong
              wait(2000)
         endif
      until uo.life >= 80
endsub




Sub checkmana()
   var mana = uo.maxmana-40
   repeat
      if uo.mana < 20 then
         uo.usetype(0x0E21) ; <- total mana pots is wrong
      endif
   until uo.mana >= mana
         


sub pvp()
   While not uo.dead() ; litte automation
      checklag()   
      checkmana()
      if uo.poisoned('self') then ; if im poisoned
         poisoned()
      endif
      if uo.life < 60 then ; if life is low
         checklife()
      endif
      if uo.life >= 60 then ; main if for the magics
           if Uo.InJournal('envenena') && UO.count(0x1F5F)>=2 then ;fs scroll
            uo.useobject(0x1F5F,'laststatus')
            delay()
            endif
         if Uo.InJournal('envenena') && UO.count(0x1F5F)<2 then    ;fs book
              UO.Cast('Flame Strike','laststatus')
            delay()
            else
            UO.Cast('Poison','laststatus') ;if others is false poison
            delay()
            endif
      endif
   wend
endsub
:? :?


Top
   
 Post subject:
PostPosted: 2010-01-08 11:58:23 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
I check it so:

Code:
  var mana = uo.mana
  var BM = uo.BM
  var SA = uo.SA
  var GS = uo.GS
  var SS = uo.SS
  var MR = uo.MR
  var BP = uo.BP
  var NS = uo.NS
  var GA = uo.GA
 
  uo.DeleteJournal()
  repeat
    wait(10)
  until uo.mana < mana || uo.InJournal('fizzles') || uo.InJournal('lack') || uo.InJournal('in line') || uo.BM < BM || uo.MR < MR || uo.SA < SA || uo.BP < BP || uo.NS < NS || uo.SS < uo.SS || uo.GA < GA || uo.GS < GS


Don't u think what'll happen if u drink total mana until the cast finish?

Mana: 30
*Casting*
*Drink total mana*
Mana: 100
*Cast finished*
Mana: 70

Script still waiting until mana will be less 30.


Top
   
 Post subject:
PostPosted: 2010-01-08 13:45:52 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
the script won't use mana and he won't do in either, and the shard doesn't have reagents

Code:
uo.usetype('type')

or
Code:
uo.usetype("type")

all functions use quotation marks except if it's an object variable
Code:
var chest="0x12345678"
uo.useobject(chest)

or
Code:
uo.addobject('chest')
uo.useobject('chest')
this is the object, not variable
the same applies to 'backpack', 'lastcontainer', etc

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


Top
   
 Post subject:
PostPosted: 2010-01-08 18:38:58 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
Nmy wrote:
the script won't use mana

Телепат?

Nmy wrote:
the script won't use mana

Кто сказал что мана будет питься в рамках этого скрипта? Отдельный хоткей для восполнения маны во время каста никто не отменял, или первое что в голову пришло написал даже не вдумываясь в то что я отписал выше?

Nmy wrote:
and the shard doesn't have reagents

Он ещё и шард указал? Может я что-то пропустил, как название?

То что у него есть наработка на восполнение маны, не знаю каким уже там у них в бразилии образом, тотал маной или бубном, ты конечно тоже пропустил?

П.С. На досуге проверь что быстрее работает- проверка на изменение маны, или реагентов, если конечно гордыня не затуманит глаза.

П.С.С. Не надо меня передёргивать когда я к тебе не обращаюсь, не дорос ещё.


Top
   
 Post subject:
PostPosted: 2010-01-09 11:16:05 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Quote:
Он ещё и шард указал? Может я что-то пропустил, как название?

viewtopic.php?p=84467#84467

Quote:
Кто сказал что мана будет питься в рамках этого скрипта?

viewtopic.php?p=84478#84478

Еще вопросы есть?

П.С.Быдло: Читай молча форум и не указывай мне что я могу или не могу делать.

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


Last edited by Nmy on 2010-01-09 11:26:07, edited 2 times in total.

Top
   
 Post subject:
PostPosted: 2010-01-09 11:23:35 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
if it helps i fixed your code a bit
Code:
Sub Delay() 
   var mana = uo.mana
   while true
      if uo.injournal("visao|frizzle") then ; out of sight
         return false
      else
         while true
            if uo.mana == mana then ;if the spell didnt land
               wait(100)
            else
               if uo.mana < mana then ;if the spell land
                  return false
               endif
            endif
         wend
      endif
      return false ;brake loop
   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 Poisoned()
   wait(500)
   repeat ; cure till poison efect is off
      checklife()
      uo.warmode(0)
      uo.waittargetself()
      uo.cast('Cure')
      wait(3000)
   until not uo.poisoned('self')
endsub
Sub checklife()
   repeat
      if uo.life <= 50 then ; check  the life is to low, then use total mana pots
         uo.usetype("0x0E21")
         wait(500)
      else
         uo.waittargetself()
         uo.usetype("0x0E21")
         wait(2000)
      endif
   until uo.life >= 80
endsub
Sub checkmana()
   var mana = uo.int-40
   repeat
      if uo.mana < 20 then
         uo.usetype("0x0E21")
      endif
   until uo.mana >= mana
endsub     
sub pvp()
   While not uo.dead() ; litte automation
      checklag()   
      checkmana()
      if uo.poisoned('self') then ; if im poisoned
         poisoned()
      endif
      if uo.life < 60 then ; if life is low
         checklife()
      endif
      if uo.life >= 60 then ; main if for the magics
         if Uo.InJournal('envenena') && UO.count("0x1F5F")>=2 then ;fs scroll
            uo.waittargetobject('laststatus')
            uo.usetype("0x1F5F")
            delay()
         endif
         if Uo.InJournal('envenena') && UO.count("0x1F5F")<2 then    ;fs book
            UO.Cast('Flame Strike','laststatus')
            delay()
         else
            UO.Cast('Poison','laststatus') ;if others is false poison
            delay()
         endif
      endif
   wend
endsub

this one is dynamic mana check - it ends loop in 20 seconds if nothing happens or quits immediately if mana drops
Code:
sub WaitForMana()
   VAR w,m=uo.mana
   for w=0 to 100
      if uo.mana<m then
         return
      endif
      wait(200)
   next
endsub

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


Top
   
 Post subject:
PostPosted: 2010-01-12 16:22:23 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
i will try it

sry for the late reponse, cuz im working like hell, but i will try it.

this its what i need:

1- a dinamic delay checker for any magic

2- well in my shard(that dont use reags), i found a full insntance that the npc, well they dont walk or walk like a tile off 3 secs, so when i am working i want to stay killing them, and they are very very strong, kill vortexes 1 hit, but they are fully vunerable to fire and poison, so i poison them and then fs their ass of, but sometimes they poison me, that why the cure there, and also they teleport close, thats why i need the dinamic delay, if i get poisoned or my magic failure before it complete the delay they have, i have to move fast so they dont kill me on a 1 hit basis, and the check life if some one trys to kill me i will heal and go invis(with a item that i won on a champ that cant be revealed)

i think its about it.


Top
   
 Post subject:
PostPosted: 2010-01-15 19:49:48 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
well, my shard removed the Spell Fizzles message, how i would get the error by sound or by the animation smoke?

ty


Top
   
 Post subject:
PostPosted: 2010-01-15 21:38:52 
Offline

Joined: 2010-01-14 14:50:13
Posts: 7
When you cast and flizzes you lost mana in your shard ? May be a solution.
However, you could try:
Code:
 ,set animecho 1
 ,set soundecho 1
 ,showjournal


Top
   
 Post subject:
PostPosted: 2010-01-17 14:10:42 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
gadly they returned the error message, so i will do it with it =)


Top
   
 Post subject:
PostPosted: 2010-01-18 06:10:10 
Offline

Joined: 2010-01-14 14:50:13
Posts: 7
Very nice script!
I try change this and made my own script, but the problem is try use this sub in pvp.
With me ever crashs in unspected sometime.


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 3 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:  
Powered by phpBB® Forum Software © phpBB Limited