| Yoko http://forum.yoko.com.ua/ |
|
| mining DRW http://forum.yoko.com.ua/viewtopic.php?f=20&t=2466 |
Page 1 of 1 |
| Author: | user_ik [ 2005-01-04 16:03:59 ] |
| Post subject: | mining DRW |
Var MiningDir="D:\Games\Ultima Online_DRW\inject\Script\mine\Mining Cool"# - Путь к скрипту Var MaxWght="450" # - Максимальный вес Var HomeRune=1 # - Номер руны в дом Var MineRune=2 # - Номер руны в шахту Var LoadContainer="0x402D239A" # - Номер загрузочного контейнера Var UnLoadContainer="0x4027EBDB" # - Номер разгрузочного контейнера Var MineBook="0x40049994" # - Номер Runebook Var HomeX="2091",HomeY="798" # - Координаты появления в доме Var MineX="2396",MineY="909" # - Координаты появления в шахте Var EscpX="2091",EscpY="798" # - Координаты появления в безопасности ############################################################ # Начало копания и контроль за смертью ############################################################ sub Start() log(0,"","") wait(500) UO.Exec("exec Mining") While not UO.Dead() wait(1000) wend uo.textopen() uo.textprint("Смерть") log(4,uo.GetGlobal("name"),"") wait(500) UO.Exec("warmode 0") UO.Exec("terminate all") end sub ############################################################ # Противостояние Элементалю ############################################################ sub ElemKill() UO.Exec("terminate Mining") UO.UseType("0x0F0E","0x0631") wait(100) repeat UO.DeleteJournal() if UO.Mana<50 then wait(14000) UO.UseType("0x0F0E","0x09DF") endif UO.WaitMenu("What","Daemon") UO.Cast("Polymorph") wait(1000) while checkmorph()==false wait(100) wend until NOT UO.InJournal("spell fizzles") UO.FindType("0x0010","0xffff","ground") UO.GetStatus("finditem") uo.SetGlobal("name",UO.GetName("finditem")) uo.textopen() uo.textprint(UO.GetName("finditem")) wait(100) lifeup("healing") UO.WarMode(1) wait(100) UO.DeleteJournal() UO.Attack("laststatus") while check("0x0010")==true gotoxy(UO.GetX("laststatus"),UO.GetY("laststatus"),1) wait(100) wend uo.SetGlobal("timekill",time()) UO.WaitTargetGround("0x19B9") wait(500) UO.Grab("all") UO.WaitTargetGround("0x0EED") wait(1500) UO.Grab("all") wait(100) UO.Exec("warmode 0") recall("1") log(5,uo.GetGlobal("name"),"") uo.textopen() uo.textprint("Поимели рудку =)") UO.Exec("exec Mining") end sub ############################################################ # Контроль за опасностью ############################################################ sub Visor() VAR asd while 1 UO.deletejournal() while not UO.InJournal(":") wait(100) wend if UO.InJournal("Elemental") then uo.SetGlobal("timeelem",time()) uo.textopen() uo.textprint("Будет бой с элементалем") UO.Exec("exec ElemKill") UO.Exec("terminate Visor") endif if UO.InJournal("attacking you") then UO.GetStatus("UO.JournalSerial(0)") uo.SetGlobal("name",UO.GetName(UO.JournalSerial(0))) log(9,uo.GetGlobal("name"),"") uo.textopen() uo.textprint("Эта крыса "+UO.GetName(UO.JournalSerial(0))+" внезапно атаковала!" ) UO.Exec("exec Escape") UO.Exec("terminate Visor") endif asd=UO.GetNotoriety(UO.JournalSerial(0)) if asd==6 then UO.GetStatus("UO.JournalSerial(0)") uo.SetGlobal("name",UO.GetName(UO.JournalSerial(0))) log(6,uo.GetGlobal("name"),"") uo.textopen() uo.textprint("В шахте оказался ПК - "+UO.GetName(UO.JournalSerial(0))) UO.Exec("exec Escape") UO.Exec("terminate Visor") endif if asd==5 then UO.GetStatus("UO.JournalSerial(0)") uo.SetGlobal("name",UO.GetName(UO.JournalSerial(0))) log(8,uo.GetGlobal("name"),"") uo.textopen() uo.textprint("В шахте вражеский гильдмэн - "+UO.GetName(UO.JournalSerial(0))) UO.Exec("exec Escape") UO.Exec("terminate Visor") endif if asd==4 then UO.GetStatus("UO.JournalSerial(0)") uo.SetGlobal("name",UO.GetName(UO.JournalSerial(0))) log(7,uo.GetGlobal("name"),"") uo.textopen() uo.textprint("В шахте оказался криминал - "+UO.GetName(UO.JournalSerial(0))) UO.Exec("exec Escape") UO.Exec("terminate Visor") endif wend end sub ############################################################ # Побег ############################################################ sub Escape() UO.Exec("terminate Mining") uo.textopen() uo.textprint("Попытка к бегству") UO.UseType("0x0F0E","0x0631") wait(100) recall("3") repeat UO.DeleteJournal() UO.WaitTargetType(0x1F14) UO.Cast("Mark") wait(8000) until NOT UO.InJournal("spell fizzles") recall("1") log(10,uo.GetGlobal("name"),"") uo.textopen() uo.textprint("Успешно скрылся") wait(300000) UO.Exec("exec Mining") end sub ############################################################ # Пополнение жизни ############################################################ sub lifeup(mode) if mode=="healing" then while UO.Life<UO.Str UO.Exec("bandageself") wait(300) UO.UseType("0x1B76") wait(4000) wend endif if mode=="bottle" then if UO.Life<UO.Str then UO.UseType("0x0F0E","0x09BB") wait(100) endif endif end sub ############################################################ # Пополнение маны ############################################################ sub manaup(mode) if mode=="meditation" then while UO.Mana<UO.Int UO.Exec("useskill Meditation") wait(4000) wend endif if mode=="bottle" then if UO.Mana<UO.Int then UO.UseType("0x0F0E","0x09DF") wait(100) endif endif end sub ############################################################ # Проверка на превращение в демона ############################################################ sub checkmorph() if UO.Mana<50 then return true endif if UO.Str>300 then return true else return false end sub ############################################################ # Проверка на координаты ############################################################ sub checkxy(CheckX,CheckY) if UO.Injournal("spell fizzles") then return true endif if UO.GetX()==val(CheckX) and UO.GetY()==val(CheckY) then return true else return false end sub ############################################################ # Проверка на тип ############################################################ sub check(type) uo.FindType(type, "-1", "ground") if uo.findcount()>0 then return true else return false endif end sub ############################################################ # Проверка на лаги ############################################################ sub checklag() repeat UO.Click("self") wait(500) until UO.InJournal(UO.GetName("self")) end sub ############################################################ # Рекалл ############################################################ sub recall(type) if type=="1" then repeat UO.DeleteJournal() UO.Recall(MineBook,str(HomeRune+1)) wait(4000) while checkxy(HomeX,HomeY)==false wait(100) wend UO.Exec("terminate Visor") until NOT UO.InJournal("spell fizzles") endif if type=="2" then repeat UO.DeleteJournal() UO.Recall(MineBook,str(MineRune+1)) wait(4000) while checkxy(MineX,MineY)==false wait(100) wend UO.Exec("terminate Visor") until NOT UO.InJournal("spell fizzles") endif if type=="3" then repeat UO.WaitTargetType(0x1F14) UO.Cast("Recal") wait(2000) while checkxy(EscpX,EscpY)==false wait(100) wend UO.Exec("terminate Visor") until NOT UO.InJournal("spell fizzles") endif end sub ############################################################ # Разгрузка и пополнение ############################################################ sub Mining() wait(1000) var cnt,itm log(1,"","") wait(500) UO.UseObject(LoadContainer) wait(500) UO.UseObject(UnLoadContainer) wait(500) UO.WarMode(0) lifeup("healing") UO.Exec("useskill Meditation") UO.FindType("0x1F4C","0x0000",LoadContainer) UO.Grab("5","finditem") wait(1000) UO.Recall(MineBook,"1") wait(500) if UO.Count("0x0E20")>0 then UO.WaitTargetType("0x1008") UO.UseType("0x0E20") wait(1500) endif UO.Exec("bandageself") wait(1500) DIM Item[13] Var i var Exit Item[1]=0x19B9 ; >3 ore Item[2]=0x19B7 ; 1 ore Item[3]=0x19BA ; 2 ore Item[4]=0x19B8 ; 3 ore Item[5]=0x0F11 ; saphires Item[6]=0x0F16 ; amethysts Item[7]=0x0F18 ; tourmalines Item[8]=0x0F15 ; citrines Item[9]=0x0F10 ; emeralds Item[10]=0x0F0F ; star sapphires Item[11]=0x0F26 ; diamonds Item[12]=0x1F4C ; recall scrolls Item[13]=0x0EED ; gold UO.SetReceivingContainer(UnLoadContainer) ; storecontainer wait(500) For i=1 to 13 Exit=0 repeat UO.FindType(Item[i]) if UO.GetQuantity("finditem")>0 then cnt=UO.GetQuantity("finditem") itm=UO.GetColor("finditem") if UO.GetGraphic("finditem")=="0x19B9" or UO.GetGraphic("finditem")=="0x19B7" or UO.GetGraphic("finditem")=="0x19BA" or UO.GetGraphic("finditem")=="0x19B8" then log(2,itm,str(cnt)) endif if UO.GetGraphic("finditem")=="0x0EED" then log(2,"gold",str(cnt)) endif if UO.GetGraphic("finditem")=="0x0F11" then log(2,"saphires",str(cnt)) endif if UO.GetGraphic("finditem")=="0x0F16" then log(2,"amethysts",str(cnt)) endif if UO.GetGraphic("finditem")=="0x0F18" then log(2,"tourmalines",str(cnt)) endif if UO.GetGraphic("finditem")=="0x0F15" then log(2,"citrines",str(cnt)) endif if UO.GetGraphic("finditem")=="0x0F10" then log(2,"emeralds",str(cnt)) endif if UO.GetGraphic("finditem")=="0x0F0F" then log(2,"star sapphires",str(cnt)) endif if UO.GetGraphic("finditem")=="0x0F26" then log(2,"diamonds",str(cnt)) endif UO.Grab("0","finditem") wait(1500) Else Exit=1 endif until Exit==1 Next UO.UnSetReceivingContainer() UO.Exec("warmode 0") wait(100) UO.WaitTargetType("0x1008") UO.UseType("0x0E20") wait(100) if UO.Count("0x0E21") <= 10 then UO.FindType("0x0E21","0x0000",LoadContainer) UO.Grab("10","finditem") wait(1500) endif if UO.Count("0x0F0E","0x09DF") <= 2 then UO.FindType("0x0F0E","0x09DF",LoadContainer) UO.Grab("5","finditem") wait(1500) endif if UO.Count("0x0F0E","0x0631") < 1 then UO.FindType("0x0F0E","0x0631",LoadContainer) UO.Grab("1","finditem") wait(1500) endif if UO.BM<20 then UO.FindType("0x0F7B","0x0000",LoadContainer) UO.Grab("20","finditem") wait(1500) endif if UO.SS<10 then UO.FindType("0x0F8D","0x0000",LoadContainer) UO.Grab("10","finditem") wait(1500) endif if UO.MR<20 then UO.FindType("0x0F86","0x0000",LoadContainer) UO.Grab("20","finditem") wait(1500) endif if UO.BP<20 then UO.FindType("0x0F7A","0x0000",LoadContainer) UO.Grab("20","finditem") wait(500) endif endif log(3,"","") wait(500) if UO.Count(0x0e86)<1 then if UO.Count(0x0e85)<1 then UO.Exec("terminate all") endif endif manaup("meditation") recall("2") UO.Exec("exec Visor") move() end sub ############################################################ # Функция передвижения ############################################################ sub Move() var cycle=0 var path="" var test=0 var i=0 var j var f=file(MiningDir+"mine_mov.dat") If NOT f.Open() Then Messagebox("Файл передвижения " +MiningDir +"mine_mov.dat не создан, Используйте record для записи") return EndIf path = f.ReadString() f.close() UO.DeleteJournal() While i<LEN(path) if VAL(path[i]) then j=VAL(path[i]) i=i+1 else j=1 endif Repeat if test<>1 then UO.DeleteJournal() mine_spot() end if ;UO.Print("Новая клетка") if not make_step(path[i]) then endif j=j-1 Until j==0 i = i + 1 if cycle && i==LEN(path) then i=0 endif Wend recall("1") Mining() UO.Exec("terminate Visor") end sub ############################################################ # Функция копания ############################################################ sub mine_spot() var maxMineTime=8000 var times=0 var timeout=0 hide() While UO.InJournal("There is no")==0 UO.DeleteJournal() UO.WaitTargetTile("1339",STR(UO.GetX()),STR(UO.GetY()),"0") if getpickaxe("0x0e86","0x0e85")==1 then else recall("1") Mining() UO.Exec("terminate Visor") endif timeout=0 times = times +1 if times>15 then wait(maxMineTime) times = 0 endif Repeat timeout=timeout+200 Wait(200) Until UO.InJournal("You put") OR UO.InJournal("There is no") OR timeout>maxMineTime if UO.weight>val(MaxWght) then recall("1") Mining() UO.Exec("terminate Visor") endif if ignoretile()==1 then return endif Wend return 0 end sub ############################################################ # Запись пути в файл ############################################################ sub record() var x var y var path="" UO.DeleteJournal() Repeat x=UO.GetX() y=UO.GetY() if waitNewPos(x,y) then path=path+extract_dir(x,y,UO.GetX(),UO.GetY()) endif Until UO.InJournal("stop") path = compressPath(path) var f=file(MiningDir +"mine_mov.dat") If NOT f.Open() Then f.Create() Messagebox("Файл передвижения " +MiningDir +"mine_mov.dat создан") endif f.Writeln(path) f.close() ;Messagebox("Файл передвижения " +MiningDir +"mine_mov.dat переписан") end sub ############################################################ # Функции кодирования и декодирования пути ############################################################ sub send_step(keycode,dir) var x = UO.GetX() var y = UO.GetY() var timeout = 0 if UO.GetDir()<>dir then UO.Press(keycode) Repeat wait(50) Until UO.GetDir()==dir endif UO.Press(keycode) Repeat timeout=timeout+50 wait(50) Until x<>UO.GetX() || y<>UO.GetY() || timeout>2000 if timeout>2000 then return 0 endif return 1 end sub sub waitNewPos(x,y) while x==UO.GetX() && y==UO.GetY() if UO.InJournal("stop") then return 0 endif wend return 1 end sub sub compressPath(path) Var i=0 Var j=0 Var newPath="" while i<LEN(path) j=1 while path[i]==path[i+1] AND j<9 i=i+1 j=j+1 wend if j==1 then newPath=newPath+path[i] else newPath=newPath+STR(j)+path[i] endif i=i+1 wend return newPath end sub sub extract_dir(x,y,a,b) if x>a then if y==b then return "i" else if y>b then return "n" else return "w" endif endif else if x<a then if y==b then return "l" else if y>b then return "e" else return "s" endif endif else if y>b then return "o" else return "k" endif endif endif end sub sub make_step(dir) if dir=="e" then send_step(39,1) return 1 endif if dir=="l" then send_step(34,2) return 1 endif if dir=="s" then send_step(40,3) return 1 endif if dir=="k" then send_step(35,4) return 1 endif if dir=="w" then send_step(37,5) return 1 endif if dir=="i" then send_step(36,6) return 1 endif if dir=="n" then send_step(38,7) return 1 endif if dir=="o" then send_step(33,0) return 1 endif return 0 end sub ############################################################ # Взятие кирки ############################################################ sub getpickaxe(apa,bpa) if UO.Count(apa)>0 then UO.UseType(apa) return 1 else if UO.Count(bpa)>0 then UO.UseType(bpa) return 1 else Messagebox("Нет кирки") return 0 endif endif end sub ############################################################ # Хайдинг ############################################################ sub hide() while NOT UO.Hidden() UO.UseSkill('Hiding') wait(3000) wend end sub ############################################################ # Клетки с такими сообщениями будут пропускаться ############################################################ sub ignoretile() if UO.InJournal("Try") then return 1 endif if UO.InJournal("Iron") then return 1 endif if UO.InJournal("Rusty") then return 1 endif if UO.InJournal("Old Copper") then return 1 endif if UO.InJournal("Copper") then return 1 endif if UO.InJournal("Dull Copper") then return 1 endif if UO.InJournal("Bronze") then return 1 endif if UO.InJournal("Silver") then return 1 endif if UO.InJournal("Shadow") then return 1 endif if UO.InJournal("Gold") then return 1 endif if UO.InJournal("Rose") then return 1 endif if UO.InJournal("Agapite") then return 1 endif if UO.InJournal("emerald") then return 1 endif if UO.InJournal("sapphire") then return 1 endif if UO.InJournal("diamond") then return 1 endif if UO.InJournal("star sapphire") then return 1 endif if UO.InJournal("amethyst") then return 1 endif if UO.InJournal("citrine") then return 1 endif if UO.InJournal("tourmaline") then return 1 endif return 0 end sub ############################################################ # Определение названия руды по цвету ############################################################ sub colortostring(color) if color=="0x0455" then return "<font color=#0000ff>Black Rock Ore</font>" endif if color=="0x0028" then return "<font color=#0000ff>Obsidian Ore</font>" endif if color=="0x008F" then return "<font color=#ff0000><B>Sand Rock Ore</B></font>" endif if color=="0x010F" then return "<font color=#ff0000><B>Krynite Ore</B></font>" endif if color=="0x09A4" then return "<font color=#ff0000><B>Crystaline Ore</B></font>" endif if color=="0x09B9" then return "<font color=#ff0000><B>Acid Ore</B></font>" endif if color=="0x09F0" then return "<font color=#ff0000><B>Gorgan Ore</B></font>" endif if color=="0x09E6" then return "<font color=#ff0000><B>Elvin Ore</B></font>" endif if color=="0x0085" then return "<font color=#ff0000><B>Dragon Ore</B></font>" endif if color=="0x0BA7" then return "<font color=#ff0000><B>Eldar Ore</B></font>" endif if color=="0x09D3" then return "<font color=#ff0000><B>Steel Ore</B></font>" endif if color=="0x08AF" then return "<font color=#ff0000><B>Plutonium Ore</B></font>" endif if color=="0x09DA" then return "<font color=#ff0000><B>Vulcan Ore</B></font>" endif if color=="0x0060" then return "<font color=#ff0000><B>Aqua Ore</B></font>" endif if color=="0x09EC" then return "<font color=#ff0000><B>BloodCrest Ore</B></font>" endif if color=="0x0482" then return "Silver Ore" endif if color=="0x052D" then return "<font color=#0000ff>Mytheril Ore</font>" endif if color=="0x0032" then return "Gold Ore" endif if color=="0x0488" then return "Bronze Ore" endif if color=="0x04C2" then return "<font color=#0000ff>Bloodrock Ore</font>" endif if color=="0x096B" then return "Shadow Ore" endif if color=="0x0014" then return "Rose Ore" endif if color=="0x07D5" then return "<font color=#0000ff>Verite Ore</font>" endif if color=="0x0193" then return "<font color=#0000ff>Agapite Ore</font>" endif if color=="0x00CE" then return "<font color=#0000ff>Valorite Ore</font>" endif if color=="0x0750" then return "Rusty Ore" endif if color=="0x060A" then return "Dull Copper Ore" endif if color=="0x0590" then return "Old Copper Ore" endif if color=="0x0088" then return "Copper Ore" endif if color=="0x0000" then return "Iron Ore" endif if color=="gold" then return "<font color=#000000><B> Золотых монет</B></font>" endif if color=="sapphires" then return "<font color=#00FF00><B> Saphires</B></font>" endif if color=="amethysts" then return "<font color=#00FF00><B> Amethysts</B></font>" endif if color=="tourmalines" then return "<font color=#00FF00><B> Tourmalines</B></font>" endif if color=="citrines" then return "<font color=#00FF00><B> Citrines</B></font>" endif if color=="emeralds" then return "<font color=#00FF00><B> Emeralds</B></font>" endif if color=="star saphires" then return "<font color=#00FF00><B> Star saphires</B></font>" endif if color=="diamonds" then return "<font color=#00FF00><B> Diamonds</B></font>" endif end sub ############################################################ # Лог ############################################################ sub log(what,name,count) var f=file(MiningDir+date()+".html") if what==0 then if not f.open() then f.create() f.writeln("<title>"+"Результаты копания "+date()+"</title><body text=#000000 bgcolor=#ffffff background=img/bg.jpg>") f.writeln("<p align=center><font size=+1><b>Начало копания "+time()+"</b></font></p><Hr size=4>") else repeat safecall f.readln() until f.eof() or fatal error f.writeln("<p align=center><font size=+1><b>Начало копания "+time()+"</b></font></p><Hr size=4>") endif f.close() endif ############################################################ if what==1 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln("<p align=center><b>Сложил в сундук "+time()+"</b></p>") f.close() endif ############################################################ if what==2 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln(count+" "+colortostring(name)+"<BR>") f.close() endif ############################################################ if what==3 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln("<Hr size=1>") f.close() endif ############################################################ if what==4 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln("<p align=center><font size=+1><b>Смерть</b></font></p><p align=justify><img align=left src=img/ghost.gif>Скончался в "+time()+"<br>Скорее всего убийцей был <font color=#ff0000>"+name+"</font><br> </p><Hr size=4>") f.close() endif ############################################################ if what==5 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln('<p align=center><font color=#ff0000><b>'+name+'</b></font></p><p align=justify><img align=left src="img/'+name+'.gif" width=80 height=80>Был выкопан в '+uo.GetGlobal("timeelem")+'<br>Был убит в '+uo.GetGlobal("timekill")+'<br> <br> </p><Hr size=1>') f.close() endif ############################################################ if what==6 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln('<p align=center><font color=#ff0000><b>'+name+'</b></font></p><p align=justify><img align=left src=img/killer.gif>Приходил в '+time()+'<br>') f.close() endif ############################################################ if what==7 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln('<p align=center><font color=#7f7f7f><b>'+name+'</b></font></p><p align=justify><img align=left src=img/criminal.gif>Приходил в '+time()+'<br>') f.close() endif ############################################################ if what==8 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln('<p align=center><font color=#7f7f7f><b>'+name+'</b></font></p><p align=justify><img align=left src=img/criminal.gif>Приходил в '+time()+'<br>') f.close() endif ############################################################ if what==9 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln('<p align=center><font color=#0000ff><b><font color=#ff0000>Нападение </font>'+name+'</b></font></p><p align=justify><img align=left src=img/killer.gif>Внезапно атаковал '+time()+'<br>') f.close() endif ############################################################ if what==10 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln('Успешно скрылся<br> </p><Hr size=1>') f.close() endif ############################################################ if what==11 then f.open() repeat safecall f.readln() until f.eof() or fatal error f.writeln("<Hr size=4>") f.close() endif end sub ############################################################ # Функция возвращения форматированной даты ############################################################ sub date() var d=str(UO.Date()),month,day,ymd,ms ymd=left(d,len(d)-2) month=right(ymd,len(ymd)-1) day=right(d,len(d)-3) if month=="01" then ms="Января" endif if month=="02" then ms="Февраля" endif if month=="03" then ms="Марта" endif if month=="04" then ms="Апреля" endif if month=="05" then ms="Мая" endif if month=="06" then ms="Июня" endif if month=="07" then ms="Июля" endif if month=="08" then ms="Августа" endif if month=="09" then ms="Сентября" endif if month=="10" then ms="Октября" endif if month=="11" then ms="Ноября" endif if month=="12" then ms="Декабря" endif return day+" "+ms end sub ############################################################ # Функция возвращения форматированного времени ############################################################ sub time() var hh,mm,ss,hms,t=str(UO.Time()) if len(t)<=2 then hh="0" mm="0" ss=t endif if len(t)==3 then hh="0" mm=left(t,len(t)-2) ss=right(t,len(t)-1) endif if len(t)==4 then hh="0" mm=left(t,len(t)-2) ss=right(t,len(t)-2) endif if len(t)==5 then hh=left(t,len(t)-4) hms=left(t,len(t)-2) mm=right(hms,len(hms)-1) ss=right(t,len(t)-3) endif if len(t)==6 then hh=left(t,len(t)-4) hms=left(t,len(t)-2) mm=right(hms,len(hms)-2) ss=right(t,len(t)-4) endif return hh+":"+mm+":"+ss end sub ############################################################ # Хождение ############################################################ sub gotoxy(x,y,prec) var ld=0,ldc=0 var dx,dy var mx,my var ox,oy,mk,k #uo.print(">") #uo.track("1",str(x),str(y)) start: mx=UO.GetX() my=UO.GetY() dx=mx-x if dx<0 then dx=0-dx endif dy=my-y if dy<0 then dy=0-dy endif if dy>dx then dx=dy end if if dx<=prec then return end if if not ldc then #uo.print(STR(dx)) end if if dx<3 then mk=70 else mk=15 end if ox=mx oy=my for k=1 to mk mx=UO.GetX() my=UO.GetY() if mx<>ox or my<>oy then goto sdidapl end if wait(10) next sdidapl: mx=UO.GetX() my=UO.GetY() dx=mx-x if dx<0 then dx=0-dx endif dy=my-y if dy<0 then dy=0-dy endif if dy>dx then dx=dy end if if dx<=prec then return end if if ld==dx then ldc=ldc+1 if ldc>100 then uo.print("Can not reach location!") return end if else ld=dx end if if mx==x then if my==y then return endif переделать поб рунбук на дрв токо ткните носам шо и куда а если несложна сами переделайте |
|
| Author: | I'm [ 2005-01-04 22:52:38 ] |
| Post subject: | |
Тыкаю носом тема раскрывалась всеми помойму уже. Раз: http://yoko.netroof.net/forum/search.php Два: http://yoko.netroof.net/forum/faq.php?mode=bbcode#5 |
|
| Author: | user_ik [ 2005-01-05 19:32:38 ] |
| Post subject: | |
Ты Лудшеб чем умничать помогбы |
|
| Author: | I'm [ 2005-01-05 20:18:53 ] |
| Post subject: | |
Ответ давался см пункт "Раз" Сам прошел для проверки. |
|
| Author: | BETEPAH [ 2005-01-05 22:17:00 ] |
| Post subject: | |
user_ik wrote: Ты Лудшеб чем умничать помогбы
Совет ...Без платный. Если бы ты Сам написал этот скрипт то сам бы думаю и вставил РУНБУКУ. А если взял у кого , тои проси у того человека его переделать . А Хамить тут будешь .......тебе некто вообще не ответит. |
|
| Author: | [HrD]ZooL [ 2005-01-06 00:25:19 ] |
| Post subject: | |
#Сначала запускаем процедуру add() потом Main(). Чар реколится в шахту, встает в хайд и начинает копать #Реколл по шахтам начинается со рунки номер = RN до 3 (можно изменить в 107 строке скрипта var HR=1 ## - Номер рунки в рунбуке домой var RN=2 ## - С какой рунки будем реколиться в шахты var oldX, oldY, time var mX, mY, mZ, i, j, jor, ser, noto var WaitTime=38000 ## - Время в секундах при ожидании пока уйдет ПК. var MaxWeight=200 ## - Вес при котором реколимся домой.(Максимальный вес) var ElementalPause=0 ## 1 - Включить паузу при выкапывании Элементала, 0 - выключить. uo.Set('norbcheck','1') ## - Для рекола. uo.Set('norbcalc','1') ## - Для рекола. sub add() uo.Print('Выбери Лопату: ') uo.Exec('addobject Shovel') while uo.Targeting() wait(100) wend uo.Print('Выбери Рунбук: ') uo.Exec('addobject Runebook') while uo.Targeting() wait(100) wend end sub sub Main() beginning: RecallToShaxta() mX = uo.getX("self") mY = uo.getY("self") mZ = uo.GetZ("self") uo.DeleteJournal() for i = mX-4 to mX+4 for j = mY-4 to mY+4 ToHide() uo.Print("Копаем в координатах: "+str(mX-i)+" "+str(mY-j)) while not uo.InJournal("no ore here") and not uo.InJournal("location") and not uo.InJournal("far away") and not uo.InJournal("in rock") and not uo.InJournal("Iron Ore") and not uo.InJournal("Copper") and not uo.InJournal("Rusty Ore") uo.DeleteJournal() if uo.Waiting() then uo.Canceltarget() end if uo.Waittargettile("1341", str(i), str(j), str(mZ)) uo.Useobject("Shovel") while not uo.InJournal("You put") and not uo.InJournal("heavy") and not uo.InJournal("location") and not uo.InJournal("no ore") and not uo.InJournal("but fail") and not uo.InJournal("far away") and not uo.InJournal("in rock") wait(500) if ElementalPause==1 then if uo.InJournal("OOPS!!!") or uo.InJournal("is attacking you") or uo.Dead() then ElementalAlarmSound() ElementalDanger() end if end if for jor = 0 to 9 ser = uo.JournalSerial(jor) noto = uo.GetNotoriety(ser) if noto <> 1 and noto <> 0 and not uo.InJournal("Elemental") then if uo.Waiting() then uo.CancelTarget() endif PKAlarmSound() PKDanger() wait(WaitTime) DropOres() wait(3000) goto reccal end if next wend if uo.Weight>MaxWeight then goto end end if wend uo.DeleteJournal() next next goto beginning end: if uo.Waiting() then uo.CancelTarget() end if uo.Print('Прыгаем Домой.') RunebookRecall(HR) wait(10000) DropOres() wait(3000) goto beginning end sub Sub RecallToShaxta() reccal: uo.DeleteJournal() if uo.Waiting() then uo.CancelTarget() end if uo.Print('Прыгаем в Шахту.') mX = uo.getX("self") mY = uo.getY("self") RunebookRecall(RN) wait(10000) CheckLag() if not uo.getX("self") <> mX and not uo.getY("self") <> mY then goto reccal end if If RN>=3 Then RN=2 Else RN=RN+1 End If end sub sub ToHide() while not uo.Hidden() CheckLag() uo.Print('Пытаемся уйти в хайд...') uo.DeleteJournal() uo.UseSkill('Stealth') wait(4100) wend wait(100) end sub sub DropOres() UO.TextOpen() UO.TextPrint('Выкладываем руду.') if uo.Waiting() then uo.CancelTarget() end if var a, Exit var UnloadChest='0x4010A242' ## - ID сундука для сброса руды. DIM Ore[5] Ore[0]=0x19B9 ## - 4 and more ore Ore[1]=0x19B7 ## - 1 ore Ore[2]=0x19BA ## - 2 ore Ore[3]=0x19B8 ## - 3 ore uo.SetReceivingContainer(UnloadChest) wait(500) for a=0 to 3 exit=0 repeat uo.UseObject(UnloadChest) uo.FindType(Ore[a]) if uo.GetQuantity('finditem')>0 then uo.Grab('0','finditem') CheckLag() wait(500) else exit=1 end if until Exit==1 next uo.UnSetReceivingContainer() end sub sub PKDanger() var mX, mY reccal: uo.DeleteJournal() if uo.Waiting() then uo.CancelTarget() end if mX = uo.getX("self") mY = uo.getY("self") uo.DeleteJournal() uo.FindType('0x1F14',-1,'mY') ### wait(200) uo.Print('ПК! Реколимся!') uo.Cast('Recall','finditem') CheckLag() wait(4000) if not uo.getX("self") <> mX and not uo.getY("self") <> mY then goto reccal end if end sub sub PKAlarmSound() uo.PlayWav("D:\Games\uo\Warning.wav") end sub sub ElementalDanger() uo.DeleteJournal() repeat wait(1000) uo.Print('Выкопан Элементал!') wait(3000) uo.Print('Скрипт на паузе!') until uo.InJournal('GO') uo.Print('Скрипт продолжен!') end if end sub sub ElementalAlarmSound() uo.PlayWav("C:\uo\Warning.wav") end sub sub RunebookRecall(n) oldX=UO.GetX() oldY=UO.GetY() Repeat UO.WarMode('0') UO.UseObject('Runebook') CheckLag() UO.LClick(135, n*15+55) CheckLag() UO.LClick(135, n*15+55) time=UO.Timer() Repeat wait(500) Until oldX<>UO.GetX() OR oldY<>UO.GetY() OR UO.Life==0 OR UO.InJournal("needs") OR time+200<UO.Timer() UO.DeleteJournal() Until oldX<>UO.GetX() OR oldY<>UO.GetY() end sub sub CheckLag() UO.DeleteJournal() UO.Click('backpack') repeat wait(500) until UO.InJournal('backpack') end sub #Скрипт переделывал под себя, еще не доделал, так что ненадо меня критиковать... #Пока не нашел процедуру сматывания от ПК, кримов и чаров в инкогнито... ну и килл элек естественно. #Авторы: ### - BETEPAH реавтор, главный скриптер. ### - cOoler добавлял, редактировал перевод и скрипт. ### А также: ### -Большое Savage, за систему сброса руды. #ну а я так... собрал из разных скриптов то что мне нужно ))) |
|
| Author: | Edred [ 2005-01-06 03:51:08 ] |
| Post subject: | |
[HrD]ZooL wrote: ##Авторы:
### - BETEPAH реавтор, главный скриптер. ### - cOoler добавлял, редактировал перевод и скрипт. ### А также: ### -Большое Savage, за систему сброса руды. #ну а я так... собрал из разных скриптов то что мне нужно ))) Что на самом деле и является авторством. Потому что большинство скриптов создается путем сбора из разных кусков. А если довести до абсурда требование подписывать каждый кусок скрипта именем автора, то давайте в комментариях к каждой команде инжекта писать копирайт Йоко |
|
| Page 1 of 1 | All times are UTC+02:00 |
| Powered by phpBB® Forum Software © phpBB Limited https://www.phpbb.com/ |
|