Advertisement
untoha

carpentry

Dec 3rd, 2018
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getfrombank(what, amount, color){      // what is string mask like "0x123|0x321"  
  2.     Orion.Say('bank');
  3.     Orion.Wait(2000);
  4.     var objs = Orion.FindType(what, color, lastcontainer, '', '2');           // Orion.GetSerial(lastcontainer)
  5.     for (var i = 0; i < objs.length; i++){
  6.         var obj = Orion.FindObject(objs[i]);
  7.         if (obj){
  8.             if (obj.Count() > amount)
  9.                 Orion.MoveItem(objs[i], amount, backpack );
  10.             if (amount >= obj.Count())
  11.                 Orion.MoveItem(objs[i], obj.Count(), backpack );
  12.             Orion.Wait(Orion.Random(1000,2000));           
  13.         }
  14.     }
  15. }
  16.  
  17. function bowcraft2(){
  18. //var pila = Orion.FindType('0x1034','0xFFFF' ,backpack, '', '5');  
  19. var iter = 0;
  20. while (true){
  21.     var gump = Orion.GetLastGump();
  22.     if (gump){
  23.         var texts = gump.TextList();   
  24.         if (texts[texts.length-1] == 'You create the item.' ||
  25.             texts[texts.length-1] == 'You create an exceptional quality item.' ||
  26.             texts[texts.length-1] == 'You failed to create the item, and some of your materials are lost.' ||
  27.             texts[texts.length-1] == 'You recycle several items.'
  28.         ){
  29.             Orion.Wait(50);
  30.             Orion.UseObject(Orion.FindType('0x1034','0xFFFF' ,backpack, '', '5')[0]);
  31.             Orion.WaitGump(Orion.CreateGumpHook('7'));
  32.             iter = 0;
  33.         }
  34.         else if (texts[texts.length-1] == "You don't have the resources required to make that item." || Player.Weight() > (Player.MaxWeight()-20)){
  35.             Orion.UseObject(Orion.FindType('0x1034','0xFFFF' ,backpack, '', '5')[0]);  // переделайте на usetype я не знал что она есть
  36.                 Orion.WaitGump(Orion.CreateGumpHook('3'))           // recicle to resources
  37.                 Orion.WaitTargetObject(self);
  38.                 Orion.Wait(1500);
  39.                 iter = 0;
  40.         }
  41.         else if (texts[texts.length-1] == "You have worn out your tool."){
  42.             //var pila = Orion.FindType('0x1034','0xFFFF' ,backpack, '', '5');  
  43.             Orion.UseObject(Orion.FindType('0x1034','0xFFFF' ,backpack, '', '5')[0]);
  44.             Orion.WaitGump(Orion.CreateGumpHook('7'));
  45.             iter = 0;
  46.         }      
  47.     }  
  48.     if (Player.Weight() > (Player.MaxWeight()-20)){
  49.         Orion.UseObject(Orion.FindType('0x1034','0xFFFF' ,backpack, '', '5')[0]);
  50.             Orion.WaitGump(Orion.CreateGumpHook('3'))           // recicle to resources
  51.             Orion.WaitTargetObject(self);
  52.             Orion.Wait(1500);          
  53.             iter = 0;
  54.     }
  55.     if (Player.Weight() < 100){
  56.             getfrombank(0x1BD7, 500, 0xffff);
  57.             Orion.Wait(2000);
  58.         iter = 0;
  59.       }
  60.       iter++;
  61.     Orion.Wait(500);   
  62.     if (iter > 10){
  63.         iter = 0;
  64.         Orion.UseObject(Orion.FindType('0x1034','0xFFFF' ,backpack, '', '5')[0]);
  65.         Orion.WaitGump(Orion.CreateGumpHook('7'));
  66.     }
  67. }
  68. //playbzzz();
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement