Yoko

All sides of Injection
It is currently 2025-12-28 18:06:20

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2009-05-05 15:35:20 
Offline

Joined: 2008-01-07 23:56:04
Posts: 24
Code:
sub move 
;===============================================
; Script Name: Move to Something
; Author: MMorning
; Version: 2.3
; Client Tested with: 4.0.10b
; EUO version tested with: 1.42 (00A5)
; Shard OSI / FS: OSI / FS
; Revision Date: 05June03
; Public Release: 05June03
; Global Variables Used: N/A
; Purpose: move to something you want to get close to.
; param    %1  ; -WC ; for world coords    or    ToObject ; to move an objetc
;          %2 world coords X   or    item type
;          %3 world coords Y   or    search_range
;          %4 world coords z
; example:    to move to an object:
;   call movesub.txt move ToObject %item  %search_range
;   gosub move ToObject %item %search_range
; example:    to move to world coords
;   call movesub.txt move -WC x_coords y_coords z_coords
;   gosub move -WC x_cords y_coords z_coords
;===============================================
deleteJournal
  set %J_CantGetThere Can't_get_there
  set %found_x -1
  set %found_y -1
  set %found_z -1
  ;
  if %0 >= 3
  {
    if %1 = ToObject
    {
      finditem %2 G_ , %3
        wait 1s
        if #findkind <> -1
        {
          set %Found_X #findx
          set %Found_y #findy
          set %found_z #findz
      }
    }
    if %1 = -wc
    {
      set %found_x %2
      set %found_y %3
      set %found_z #findz
 
      if %0 >= 4
      {
        set %found_z %4
      }
    }
    if %found_X >= 0
    {
      moveloop:
    Set %J_Index #JINDEX
    set %dx #charposx - %found_x abs
    set %dy #charposy - %found_y abs
    if %dx => 2 || %dy => 2 ||
          {
      event pathfind %found_X %found_y
      wait 1s
      for %find_loop %J_Index #jindex
      {
        Scanjournal %findloop
        if %J_CantGetThere in #journal
          return
      }
      goto moveloop
      }
    }
   }
return


Как вызвать ету бегалку в уо? Для бегания к координатам


Top
   
 Post subject:
PostPosted: 2009-05-05 21:38:04 
Offline
User avatar

Joined: 2006-11-06 21:45:23
Posts: 137
В начало приведенного тобой скрипта добавляешь перед sub move этот кусок кода:
Code:
initevents
   set *11 0
   set *12 0
   set *13 0
   set *14 0
loop:
   if *11 <> 0
   {
      wait 2
      gosub move -wc *12 *13 *14
      set *11 0
   }
goto loop

Тогда эту ходилку можно будет вызвать через инжу используя процедуру:
Code:
SUB EasyUOWalker(x,y,z)  #X,Y,Z - целевые координаты.
   UO.SetEasyUO(11,"1")
   UO.SetEasyUO(12,x)
   UO.SetEasyUO(13,y)
   UO.SetEasyUO(14,z)
   repeat
      wait(50)
   until UO.GetEasyUO(11) == "0"
endsub

Соответственно надо не забыть перед запуском скрипта на инже запустить скрипт на изе с приведенным мной дополнением. И еще, если растояние между начальными и конечными координатами X или Y будет больше, чем 14 клеток (кажется так), то ходилка не станет ходить.
Чуть не забыл. Спасибо Edred'у за то что он показал как связать хождение на изе с инжой.


Top
   
 Post subject:
PostPosted: 2009-05-06 22:37:06 
Offline

Joined: 2008-01-07 23:56:04
Posts: 24
Сенк, работает)


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 4 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