Yoko

All sides of Injection
It is currently 2024-03-28 15:34:34

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 2012-05-13 12:44:40 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Знакомая попросила подработать грузчиком - перенести вещи через портал с базы на базу. так как там было много дерева и железа в слитках набросал скрипт на "взял, шагнул, положил, шагнул назад".
И не получилось...
Перепробовал 3 разные ходилки. После прыжка в телепорт (аналог мунгейта, перелет при наступании на тайл) чар начинает дергатсья и в 90% случаев улетает назад.
На изиуо та же беда.

Выручил только стелс. Вся таскательная операция на нем заняла несколько минут. Дольше мучал инжект.

Разочарован... :(

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


Top
   
PostPosted: 2012-05-13 13:48:01 
Offline

Joined: 2011-06-11 19:54:23
Posts: 820
Code:
sub main()
   var mtype='0x0F6C' #Тип портала
   var mcolor=-1 #Цвет портала
   var dist=1 #finddistance
   var ox=uo.getx()-1 #Куда отойти в начале
   var oy=uo.gety()+1 #Куда отойти в начале
   
   var mx=uo.getx()
   var my=uo.gety()
   var tx=0,ty=0
   WalkTo(ox-mx,oy-my)
   mx=uo.getx()
   my=uo.gety()
   uo.set('finddistance',str(dist))
   uo.findtype(mtype,mcolor,-1)
   if uo.findcount() then
      tx=uo.getx('finditem')
      ty=uo.gety('finditem')
      WalkTo(tx-mx,ty-my)
   endif
end sub

Sub WalkTo(x,y)
   var dly=400 #Задержка на перемещения
   dim keys[8]
   keys[0]=33
   keys[1]=39
   keys[2]=34
   keys[3]=40
   keys[4]=35
   keys[5]=37
   keys[6]=36
   keys[7]=38
   var key=GetDirTo(x,y)
   if (key==-1) then
      uo.print('Уже стоим на этой точке.')
      return
   endif
   if (uo.getdir()<>key) then
      while (uo.getdir()<>key)
         uo.press(keys[key])
         wait(dly)
      wend
   endif
   uo.press(keys[key])
   wait(dly)
end sub

Sub GetDirTo(dx,dy)
   If dx<>0 AND dy<>0 Then
      If dx>0 AND dy>0 Then
         return 3
      Endif
      If dx>0 AND dy<0 Then
         return 1
      Endif
      If dx<0 AND dy>0 Then
         return 5
      Endif
      If dx<0 AND dy<0 Then
         return 7
      Endif
   Endif
   If dx<>0 AND dy==0 Then
      If dx>0 Then
         return 2
      Endif
      If dx<0 Then
         return 6
      Endif
   Endif
   If dx==0 AND dy<>0 Then
      If dy>0 Then
         return 4
      Endif
      If dy<0 Then
         return 0
      Endif
   Endif
   return -1
end sub


Нэ?)


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

All times are UTC+02:00


Who is online

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