Yoko

All sides of Injection
It is currently 2025-11-23 01:45:37

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 2010-01-07 13:47:19 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
Well
I´ve tryed to use this script on UO, and this wheres i need help considerations:
1°- checklag goes on a eternal loop because on my sever the backpack shows this: [newbie] backpack (%weight% Kg[THIS IS THE W8 ON KILOS])
2°- my check mana for some reason dont work propely
3°- for some reason the first run execute the delay sub right the other times it only ignored it

well this is my first script, and as a brasilian using tradutors and translates softwares its hard to find materials on this site, since i have to translate to english then to portuguese, plz help me out.

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('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(0x0F0E,0x00FF) ; <- life pots
         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()
   repeat
      var mana2 = uo.int-40
      if uo.mana < 20 then
         uo.usetype(0x0F0E,0x0480) ; mana pots
      endif
   until uo.mana >= mana2
   
   sub pvm()
      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
[/b]


Top
   
PostPosted: 2010-01-07 16:02:11 
Offline
User avatar

Joined: 2007-11-01 19:09:30
Posts: 287
Location: Moscow
Xpree wrote:
Code:
   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 # IMAGINE YOU REGENED SOME MANA, SO HERE NEED TO BE >=
               wait(100)
            else
               if uo.mana < mana then ;if the spell land
                  return false
               endif
            endif
            # OR! YOU CAN PUT DELAY HERE (100) MINIMUM OR IT LAGS CLIENT
         wend # IF YOU LACK REAGENTS YOU'll STUCK HERE FOREVER AND SO ON
      endif
      return false ;brake loop  # HERE YOU INTERRUPT YOUR LOOP, SO IT DOESN'T WORK
   wend
endsub
# ALSO THERE IS WAY TO CHECK SPELL PASSED WITH UO.SET('ANIMECHO','1') AND FIND SOMETHING LIKE anim [0xYYYY] in journal

; 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('backpack') then
         return 1
      endif
      wait(200)
   next
endsub
# THIS IS NOT A CHECKLAG, THIS IS A PIECE OF SHIT, AND THAT IS CHECKLAG:

sub checklag()
   deljournal('backpack')
   uo.click('backpack')
   repeat
      wait(100)
   until uo.injournal('backpack')
endsub

sub deljournal(msg)
   while uo.injournal(msg)
      uo.setjournalline(uo.injournal(msg)-1,'')
   wend
endsub

##############################################


sub Poisoned()
   wait(500)
   repeat ; cure till poison efect is off
      checklife()
      uo.warmode(0)
     # AFTER YOU SET WARMODE YOU NEED TO WAIT A BIT, SAME AS BETWEEN EVERY 2 ACTIONS THAT SEND SOME PACKET TO SERVER
      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(0x0F0E,0x00FF) ; <- life pots
         wait(500)
      else
         uo.waittargetself()
         uo.usetype(0x0E21) ; <- the type of the bandages is wrong # BETTER TO USE BRACKETS - '0x0E21' - LIKE THAT, AND THE TYPE OF BANDAGES IS RIGHT
         wait(2000)
      endif
   until uo.life >= 80
endsub

Sub checkmana()
   repeat
      var mana2 = uo.int-40
      if uo.mana < 20 then
         uo.usetype(0x0F0E,0x0480) ; mana pots
      endif
   until uo.mana >= mana2 # DIDN'T YOU THINK ABOUT MEDITATION HERE?
   
   sub pvm()
      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 # BRACKETS
               uo.useobject(0x1F5F,'laststatus') # BRACKETS
               delay()
            endif
            if Uo.InJournal('envenena') && UO.count(0x1F5F)<2 then    ;fs book # BRACKETS
               UO.Cast('Flame Strike','laststatus')
               delay()
            else
               UO.Cast('Poison','laststatus') ;if others is false poison
               delay()
            endif
         endif
         # DELAY (100)
      wend
   endsub
[/b]


THAT IS NOT FULL LIST OF CORRECTIONS, JUST WHAT I SEE WITHOUT DEEP LOOKING

_________________
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side


Top
   
 Post subject:
PostPosted: 2010-01-07 17:07:36 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
well im such a sameless newbie yet, ty for this helps, i will make this changes and report here after that, but only like 6 pm here, cuz im at work.


ah about reagentes, my server don´t use reagentes


Top
   
 Post subject:
PostPosted: 2010-01-07 18:19:29 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
insted of this mad scripting you only need like 3 hotkeys -
usetype mana
usetype great heal
exec fs
Code:
sub fs()
   if uo.count('0x1F5F') then
      uo.waittargetobject('lastattack')
      uo.usetype('0x1F5F')
   else
      uo.cast('Flame Strike','lastattack')
   endif
endsub

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


Top
   
 Post subject:
PostPosted: 2010-01-07 22:22:32 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
autoscript is sucks :lol:

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


Top
   
 Post subject:
PostPosted: 2010-01-08 02:48:18 
Offline

Joined: 2010-01-06 17:18:40
Posts: 19
but i want to create a futher script to afk pvm macro with auto loot and recalling, ressuretion and others, but i have to start with something more easy.


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