Yoko

All sides of Injection
It is currently 2025-10-15 14:00:52

All times are UTC+02:00




Post new topic  Reply to topic  [ 11 posts ] 
Author Message
PostPosted: 2011-01-09 20:54:41 
Offline

Joined: 2011-01-09 20:47:21
Posts: 5
sub main()
##########################################
# Mining v1.02 #
# By Scripts Writer #
# icq : 424131028 #
# Thx to Savage's WalkN() #
# Thx to Mihail's date & time #
##########################################
# Antares. http://www.uoa.ru #
##########################################

var f=file('C:\mining.txt') #File where tile coordinates
var FromFile=1 #1-From file, 0-From client
var Hiding=0 #1-To hide before moving, 0-Don't hide
var EatFood=0 #1-To eat food, 0-Don't eat
var RuneToHome='0x4000FD35' #ID of rune to home
var RuneToMine='0x4000FD36' #ID of rune to cave
var Sunduk='0x4000F8EF' #ID of container where to put ores
var PickAxe=0x0E85 #Type of Pickaxe
var food=0x097B #Type of food to eat
var MaxWeight=400 #MaxWeight when to go unload

var msg1='Вы положили' #Msg 'You put'
var msg2='Вам не удалось' #Msg 'You fail to mine'
var msg3='Тут ничего нету' #Msg 'There is nothing ore'

#############################################################
#В бекпеке несколько кирок, руны в дом и шахту, реагенты.
#Устанавливаем флаг FromFile=0 и запускаем скрипт.Прицелами
#указываем на тайлы в шахте, собирая тем самым координаты
#по которым будем ходить и обкапывать в дальнейшем. Как только
#собрали, копируем информацию с тайлами и вставляем в ранее
#созданный файл mining.txt в каталое C:\ . На последней пустой
#строке помещаем 0 в начало строки-для определения конца файла.
#Устанавливаем флаг FromFile=1, указываем все значения #переменных
#и запускаем главную функцию main.
#############################################################
#In backpack there are some pickaxes,
#runes to the house and mine, reagents.
#We establish flag FromFile=0 and start a script.
#By targets click on tiles in cave,
#collecting that coordinates on which we shall go and
#mine in the further. As soon as have collected,
#we copy the information with tiles and it is
#inserted into earlier created file "mining.txt" in
#directory C:\. On last empty line it is placed 0 in the
#beginning of a line-for of definition of the end of a file.
#We establish flag FromFile=1, specify all
#values of variables and start main function.
#############################################################
#
# v1.01 Подправил медитацию. Добавил ведение лога в отдельном окне.
# v1.02 Изменение скрипта на вывод времени в лог.

Code:
DIM ore[4]

ore[0]='0x19B7'
ore[1]='0x19BA'
ore[2]='0x19B8'
ore[3]='0x19B9'

DIM XTile[550],YTile[550],ZTile[550]
var TileType
var mx,my
var i,k,l,mana
k=0

if FromFile==0 then
    uo.DeleteJournal()
    repeat
        uo.AddObject('Tile')
        wait(250)
        while uo.Targeting()
            wait(100)
        wend
        uo.WaitTargetTile('lasttile')
        uo.Say(',infotile')
        wait(500)
    until uo.InJournal('stop')
    return
else
    f.Open()
    repeat
        TileType=safe call f.ReadNumber()
        XTile[k]=safe call f.ReadNumber()
        YTile[k]=safe call f.ReadNumber()
        ZTile[k]=safe call f.ReadNumber()
        if TileType<>1 then
            uo.Print(STR(XTile[k])+' '+STR(YTile[k])+' '+STR(ZTile[k]))
        end if
        k=k+1
    until TileType==0
    uo.Print('There are '+STR(k-1)+' tiles in a file.')
    f.Close()
end if
while not uo.Dead()
    for i=0 to k-2
        if Hiding==1 then
            while not uo.Hidden()
                uo.WarMode(0)
                uo.Print('Try to hide yourself...')
                uo.UseSkill('Hiding')
                wait(3500)
            wend
        end if
        if i==0 && uo.GetX('self')==358 && uo.GetY('self')==1443 then
            WalkN(364,1438,"")
            WalkN(382,1439,"")
        end if
        WalkN(XTile[i],YTile[i],"")
        uo.Print('Start to mine '+STR(XTile[i])+' '+STR(YTile[i])+' '+STR(ZTile[i])+' tile.')
        repeat
            uo.DeleteJournal()
            l=0
            uo.WaitTargetTile('-1',XTile[i],YTile[i],ZTile[i])
            uo.UseType(PickAxe)
            repeat
                wait(100)
                l=l+1
            until uo.InJournal(msg1) || uo.InJournal(msg2) || uo.InJournal(msg3) || l>100
        until uo.InJournal(msg3) || l>100
        if uo.Weight>MaxWeight then
            repeat
                mx=uo.GetX('self')
                my=uo.GetY('self')
                mana=uo.mana
                if uo.mana < 30 then
                    uo.Print('Start meditation ... ')
                    uo.WarMode(0)
                    repeat
                        uo.UseSkill('Meditation')
                        l=0
                        uo.DeleteJournal()
                        if uo.WarMode==1 then
                            uo.WarMode(0)
                        end if
                        wait(250)
                        repeat
                            wait(100)
                            l=l+1
                        until uo.InJournal('Вы потеряли') || l>100 || uo.mana>=30
                    until uo.mana >= 30
                end if
                l=0
                uo.Print('Start to recall home ...')
                uo.WaitTargetObject(RuneToHome)
                uo.Cast('Recall')
                repeat
                    wait(100)
                    l=l+1
                until mx<>uo.GetX('self') || my<>uo.GetY('self') || uo.mana<mana || l>100
            until mx<>uo.GetX('self') || my<>uo.GetY('self')
            uo.Print('We are at home.Start to unload...')
            WalkN(uo.GetX(Sunduk),uo.GetY(Sunduk),Sunduk)
            uo.UseObject(Sunduk)
            wait(500)
            uo.TextOpen()
            uo.TextPrint(date(uo.date(),'.'))
            uo.TextPrint(time(uo.time(),':'))
            uo.TextPrint('------------------------')
            for k = 0 to 3
                uo.FindType(ore[k],'-1','backpack')
                while uo.FindCount()
                    uo.Click('finditem')
                    wait(500)
                    uo.TextPrint(uo.GetName('finditem'))
                    uo.moveitem('finditem','all',Sunduk)
                    wait(1000)
                    uo.FindType(ore[k],'-1','backpack')
                wend
            next
            uo.TextPrint('------------------------')
            uo.IgnoreReset()
            uo.Print('Upload was complete. Would you like to eat something?')
            if EatFood==1 then
                uo.DeleteJournal()
                uo.FindType(food,'-1',Sunduk)
                if uo.FindCount() then
                    uo.moveitem('finditem','30','backpack')
                    wait(1000)
                    repeat
                        wait(1000)
                        uo.UseType(food)
                    until uo.InJournal('You are simply')
                end if
                uo.FindType(food,'-1','backpack')
                if uo.FindCount() then
                    uo.moveitem('finditem','all',Sunduk)
                    wait(1000)
                end if
            end if
            repeat
                mx=uo.GetX('self')
                my=uo.GetY('self')
                mana=uo.mana
                if uo.mana < 30 then
                    uo.Print('Start meditation ... ')
                    uo.WarMode(0)
                    repeat
                        uo.UseSkill('Meditation')
                        l=0
                        uo.DeleteJournal()
                        if uo.WarMode==1 then
                            uo.WarMode(0)
                        end if
                        wait(250)
                        repeat
                            wait(100)
                            l=l+1
                        until uo.InJournal('Вы потеряли') || l>100 || uo.mana>=30
                    until uo.mana >= 30
                end if
                l=0
                uo.Print('Start to recall mine ...')
                uo.WaitTargetObject(RuneToMine)
                uo.Cast('Recall')
                repeat
                    wait(100)
                    l=l+1
                until mx<>uo.GetX('self') || my<>uo.GetY('self') || uo.mana<mana || l>100
            until mx<>uo.GetX('self') || my<>uo.GetY('self')
        end if
    next
    wait(600000)
wend
end sub

sub WalkN(x,y,Target)
VAR i,StepSucess
VAR dx,dy,Exit=0
While Exit<>1
    If Target<>"" Then
        dx=UO.GetX(Target)-UO.GetX()
        dy=UO.GetY(Target)-UO.GetY()
        If UO.GetDistance(Target)<3 Then
            Exit=1
        Endif
    Else
        dx=x-UO.GetX()
        dy=y-UO.GetY()
        If dx==0 AND dy==0 Then
            Exit=1
        Endif
    Endif
    If dx<>0 AND dy<>0 Then
        If dx>0 AND dy>0 Then
            StepSucess=Go(3,40,300) ;SE - DownArrow
            If StepSucess==-1 Then
                StepSucess=Go(7,38,300) ;WN - UpArrow
                StepSucess=Go(1,39,300) ;NE - RightArrow
                If StepSucess==-1 Then
                    StepSucess=Go(5,37,300) ;SW - LeftArrow
                Endif
            Endif
        Endif
        If dx>0 AND dy<0 Then
            StepSucess=Go(1,39,300) ;NE - RightArrow
            If StepSucess==-1 Then
                StepSucess=Go(5,37,300) ;SW - LeftArrow
                StepSucess=Go(3,40,300) ;SE - DownArrow
                If StepSucess==-1 Then
                    StepSucess=Go(7,38,300) ;WN - UpArrow
                Endif
            Endif
        Endif
        If dx<0 AND dy>0 Then
            StepSucess=Go(5,37,300) ;SW - LeftArrow
            If StepSucess==-1 Then
                StepSucess=Go(1,39,300) ;NE - RightArrow
                StepSucess=Go(7,38,300) ;WN - UpArrow
                If StepSucess==-1 Then
                    StepSucess=Go(3,40,300) ;SE - DownArrow
                Endif
            Endif
        Endif
        If dx<0 AND dy<0 Then
            StepSucess=Go(7,38,300) ;WN - UpArrow
            If StepSucess==-1 Then
                StepSucess=Go(3,40,300) ;SE - DownArrow
                StepSucess=Go(5,37,300) ;SW - LeftArrow
                If StepSucess==-1 Then
                    StepSucess=Go(1,39,300) ;NE - RightArrow
                Endif
            Endif
        Endif
    Endif
    If dx<>0 AND dy==0 Then
        If dx>0 Then
            StepSucess=Go(2,34,300) ;E - PgDown
            If StepSucess==-1 Then
                StepSucess=Go(3,40,300) ;SE - DownArrow
                If StepSucess==-1 Then
                    StepSucess=Go(1,39,300) ;NE - RightArrow
                Endif
                StepSucess=Go(2,34,300) ;E - PgDown
            Endif
        Endif
        If dx<0 Then
            StepSucess=Go(6,36,300) ;W - Home
            If StepSucess==-1 Then
                StepSucess=Go(7,38,300) ;WN - UpArrow
                If StepSucess==-1 Then
                    StepSucess=Go(5,37,300) ;SW - LeftArrow
                Endif
                StepSucess=Go(6,36,300) ;W - Home
            Endif
        Endif
    Endif
    If dx==0 AND dy<>0 Then
        If dy>0 Then
            StepSucess=Go(4,35,300) ;S - End
            If StepSucess==-1 Then
                StepSucess=Go(3,40,300) ;SE - DownArrow
                If StepSucess==-1 Then
                    StepSucess=Go(5,37,300) ;SW - LeftArrow
                Endif
                StepSucess=Go(4,35,300) ;S - End
            Endif
        Endif
        If dy<0 Then
            StepSucess=Go(0,33,300) ;N - PgUp
            If StepSucess==-1 Then
                StepSucess=Go(1,39,300) ;NE - RightArrow
                If StepSucess==-1 Then
                    StepSucess=Go(7,38,300) ;WN - UpArrow
                Endif
                StepSucess=Go(0,33,300) ;N - PgUp
            Endif
        Endif
    Endif
Wend
end sub

sub Go(dir,key,walkwait)
VAR x,y, OldDir
x=UO.GetX()
y=UO.GetY()
OldDir=UO.GetDir()
If UO.GetDir()<>dir Then
    UO.Press(key)
    wait(walkwait)
    If UO.GetDir()<>dir Then
        CheckLag()
    Endif
Endif
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
    CheckLag()
Endif
If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then
    UO.Press(key)
    wait(walkwait)
Endif
If x==UO.GetX() AND y==UO.GetY() Then
    CheckLag()
Endif
If x==UO.GetX() AND y==UO.GetY() Then
    UO.Print("Zasada!")
    return -1
Else
    return 1
Endif
end sub
#########################################
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
    wait(500)
until UO.InJournal('Backpack')
end sub

sub date(jor,n)
var ser=str(jor), t=''
if len(ser)==5 then
    ser='0'+ser
end if
t=right(ser,2)+n+mid(ser,2,2)+n+left(ser,2)
return t
end sub

sub time(jor,n)
var ser=str(jor),t=''
if len(ser)==5 then
    ser='0'+ser
end if
t=left(ser,2)+n+mid(ser,2,2)+n+right(ser,2)
return t
end sub




Как зделать чтобы начинал копать передсобой а не из подсебя .. тк на шарде подсебя копать нельзя ( Помоги


Top
   
PostPosted: 2011-01-09 21:21:29 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
В скрипте копает там где стоит:
Code:
uo.WaitTargetTile('-1',XTile[i],YTile[i],ZTile[i])
uo.UseType(PickAxe)


Прибавляй к любой координате +1 или вычитай -1 и будет рядом копать.
Ну или возьми другой скрипт :)

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


Top
   
PostPosted: 2011-01-10 03:35:55 
Offline

Joined: 2011-01-09 20:47:21
Posts: 5
Mirage wrote:
В скрипте копает там где стоит:
Code:
uo.WaitTargetTile('-1',XTile[i],YTile[i],ZTile[i])
uo.UseType(PickAxe)


Прибавляй к любой координате +1 или вычитай -1 и будет рядом копать.
Ну или возьми другой скрипт :)


Я сам не скриптер .. мб за реал ктото согласиться помочь ?


Top
   
PostPosted: 2011-01-10 07:27:00 
Offline
User avatar

Joined: 2009-03-21 10:03:06
Posts: 165
Location: Одесса-Мама
Напиши строчку, которая вылазит, когда ты копаешь под собой.

_________________
Спасибо всем, у кого учился!

Меня трудно найти, легко потерять, и невозможно забыть. Я - рабочий исходник!


Top
   
PostPosted: 2011-01-10 13:31:51 
Offline

Joined: 2011-01-09 20:47:21
Posts: 5
I connot mine so close to myself

сори что долго неотвечал "работа"


Top
   
PostPosted: 2011-01-10 14:28:51 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Ddthху в шапке добавь строку

Code:
var msg4='mine so close'

в самом скрипте где есть
Quote:
|| uo.InJournal(msg3) || uo.InJournal(msg4)

сделаешь вот так. Попробуй - отпишись.

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


Top
   
PostPosted: 2011-01-10 14:47:14 
Offline

Joined: 2011-01-09 20:47:21
Posts: 5
Code:
 until uo.InJournal(msg1) || uo.InJournal(msg2) || uo.InJournal(msg3) || l>100
      until uo.InJournal(msg4) || l>100
Так ?


Code:
 var msg4='mine so close'
  var f=file('C:\mining.txt') #File where tile coordinates
  var FromFile=1              #1-From file, 0-From client
  var Hiding=0                #1-To hide before moving, 0-Don't hide
  var EatFood=0               #1-To eat food, 0-Don't eat
  var RuneToHome='0x4000FD35' #ID of rune to home
  var RuneToMine='0x4000FD36' #ID of rune to cave
  var Sunduk='0x4000F8EF'     #ID of container where to put ores
  var PickAxe=0x0E85          #Type of Pickaxe
  var food=0x097B             #Type of food to eat
  var MaxWeight=400           #MaxWeight when to go unload


Так ? )


Top
   
PostPosted: 2011-01-10 17:11:54 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Code:
var msg1='Вы положили' #Msg 'You put'
var msg2='Вам не удалось' #Msg 'You fail to mine'
var msg3='Тут ничего нету' #Msg 'There is nothing ore'
var msg4='mine so close'




until uo.InJournal(msg1) || uo.InJournal(msg2) || uo.InJournal(msg3) || uo.InJournal(msg4) || l>100
until uo.InJournal(msg3) || uo.InJournal(msg4) || l>100


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


Top
   
PostPosted: 2011-01-10 20:13:17 
Offline

Joined: 2011-01-09 20:47:21
Posts: 5
Мираж спосибо тебе конечно . но я так нечего и непонял )) .. вот скрипт есть работает тольео нелетает и невыкладывает .. можно както с тобой договориться чтоб ты доделал его за денежку ? Спосибо ) или еше ктонебудь ..Версия инжекта 2.0.3
Забыл добавить и с ремарком рун всех что в дом что лес..

Code:
sub main() 
UO.DeleteJournal()
var x, y, i, tmp, inside, goto_x, st, first
st=0
first=UO.GetX()
start:
inside=0
for y=-2 to 2
for x=-2 to 2
try: 
UO.Exec ("waittargettile "+" 1340 "+STR(UO.GEtX()+x)+" "+STR(UO.GetY()+y)+" 0")
UO.exec ("usetype 0x0E85")
#UO.Print (""+STR(x))
#UO.Print (""+STR(y))
i=0
while i< 100
if UO.InJournal("but fail") or UO.InJournal("I decide") then
wait (1000)
i=200
UO.DeleteJournal()
goto try
endif
if UO.InJournal("I put") then
i=200
UO.DeleteJournal()
goto try
endif
if UO.InJournal("perform another action") then
wait (1000)
i=200
UO.DeleteJournal()
goto try
endif
if UO.InJournal("nothing here") or UO.InJournal("far away") or UO.InJournal("cannot mine") then
wait (1000)
i=200
UO.DeleteJournal()
endif
if UO.InJournal("location") then
wait (1000)
i=200
UO.DeleteJournal()
endif
wait (500)
i=i+1
wend
next
next

if st == 0 then
goto_x=UO.GetX()+5
while inside < 10
while UO.GetX() < goto_x
UO.Press (39, 1, 500)
inside=0
wend
while UO.GetX() > goto_x
UO.Press (37, 1, 500)
inside=0
wend
inside=inside+1
wait (300)
wend
st=1
goto start
endif

if st == 1 then
while inside < 10
while UO.GetX() < first
UO.Press (39, 1, 500)
inside=0
wend
while UO.GetX() > first
UO.Press (37, 1, 500)
inside=0
wend
inside=inside+1
wait (300)
wend
st=0
endif
goto start
end sub


Top
   
PostPosted: 2011-01-11 11:08:51 
Offline

Joined: 2010-12-14 11:52:17
Posts: 13
Quote:
Версия инжекта 2.0.3

Версия клиента может быть такая?


Top
   
PostPosted: 2011-01-11 14:02:39 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Superuser wrote:
Quote:
Версия инжекта 2.0.3

Версия клиента может быть такая?

Он имел ввиду версию клиента :)

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


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

All times are UTC+02:00


Who is online

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