SHARE
TWEET

Untitled

a guest Aug 21st, 2019 112 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function fishing()
  2. {
  3.     while(true){        
  4.         var alarm = 'e:/alarm1';//Путь к файлу с Алармом
  5.         var caught = Orion.FindType('0x1078|0x1B9B|0x1940|0x0FC5|0x1BEF|0x1B1B|0x1B15|0x1B12|0x1B17|0x1B13|0x0F83|0x0DD6|0x0F7E|0x0F80|0x0F90|0x0F82','-1',backpack);
  6.         //Укажи вес при котором чар будет разгружаться
  7.         var stopweight = 400;
  8.         Orion.ClearJournal();
  9.         Orion.WaitTargetTileRelative('any', -5, 0, 0);
  10.         Orion.UseType('0x0DBF', '-1');
  11.         timer = Orion.Now();
  12.         Antimacro(timer);
  13.         Orion.WaitJournal('too far|You pull|You fish a while|no fish|Try fishing in water', Orion.Now(), Orion.Now() + 5000);
  14.  
  15.         //Если появился моб
  16.         var mob = Orion.FindType("!0x0190|!0x0191", "-1", "ground", "near|live|ignorefriends", 3, "grey|gray|criminal|red");
  17.         if (mob.length){
  18.             Orion.Say('Stop');
  19.             KillMobFishing();
  20.             Orion.Wait(100);
  21.             LootMob();
  22.             Orion.Say('Forward');
  23.         }
  24.  
  25.         //Если увидели гма
  26.         if (Orion.InJournal('GM|Seer|тут?|tyt?|tyt|Counsler|Counselor|Divine|Divine Dragon|Wald|Tirael|тут')){
  27.             Orion.ActivateClient();
  28.             Orion.PlayWav(alarm);
  29.             Orion.Wait(500);
  30.             Orion.PlayWav(alarm);
  31.             Orion.Wait(500);
  32.             Orion.PlayWav(alarm);
  33.             Orion.Wait(500);
  34.             Orion.PlayWav(alarm);
  35.             Orion.Wait(500);
  36.             Orion.ClearJournal();
  37.             Orion.Wait(100);
  38.         }
  39.         //Если вес превысил указанный разгружаемся
  40.         if (Player.Weight() >= stopweight){
  41.         unloadfishinraft();
  42.         }
  43.  
  44.         //Если стоим на месте, или рыбы нет
  45.         if (Orion.InJournal('There are no fish|Try fishing in water')){
  46.             Orion.Say('Forward');
  47.             Orion.Wait(2000);
  48.         }
  49.         //Если уперлись в конец карты
  50.         if (Orion.InJournal("We've stopped Cap'n")){
  51.             Orion.ClearJournal();
  52.             Orion.Say('Turn Around');
  53.             Orion.Wait(500);
  54.             Orion.Say('Forward');
  55.             Orion.Wait(500);
  56.             Orion.Say('Forward');
  57.             Orion.Wait(8000);
  58.             Orion.Say('Left');
  59.             Orion.Wait(3000);
  60.             Orion.Say('Stop');
  61.             Orion.Wait(500);
  62.             Orion.Say('Forward');
  63.         }
  64.     }
  65. }
  66.  
  67. function KillMobFishing()
  68. {
  69.     Orion.WarMode(false);
  70.     Orion.Ignore(self);
  71.     var target = Orion.FindType("!0x0190|!0x0191", "-1", "ground", "near|live|ignorefriends", 3, "grey|gray|criminal|orange|red|innocent");
  72.     if (target.length != 0){
  73.         Orion.Say('Stop');
  74.         var obj1 = Orion.FindObject(target[0]);
  75.         Orion.WarMode(true);
  76.         Orion.Ignore(target[0]);
  77.         Orion.ClientLastAttack(target);
  78.         Orion.AddObject('enemy',target[0])
  79.         Orion.GetStatus('enemy');
  80.         while (obj1.Exists()){
  81.             Orion.UseType('0x13FE','!0x0514');
  82.             Orion.UseType('0x1B78','0x0455');
  83.             Orion.UseType('0x1B76','0xFFFF');
  84.             Orion.Attack('enemy');
  85.             Orion.Wait(1500);
  86.             if (Player.Hits('%') <= 40){
  87.                 Orion.UseType('0x0F0C','0xFFFF');
  88.                 Orion.Wait(500);
  89.             }
  90.         }
  91.         //Если умер останавливаем.
  92.         if (Player.Dead()){
  93.             break;
  94.         } else {
  95.             Orion.Wait(1000);
  96.         }
  97.     }
  98. }
  99.  
  100. function LootMob()
  101. {
  102.     var corpse = Orion.FindType('0x2006', '-1', ground, '', 3);
  103.     for (var c = 0; c < corpse.length; c++)
  104.     {
  105.         var serial = corpse[c];
  106.         Orion.WaitTargetObject(serial);
  107.         Orion.Wait(300);
  108.         Orion.UseType('0x0EC2|0x13F6');
  109.         Orion.Wait(150);
  110.         Orion.UseObject(serial);
  111.         Orion.Wait(150);
  112.         var list = Orion.FindType('-1','-1', serial, '', '', '', true);
  113.         for (var i = 0; i < list.length; i++)
  114.         {
  115.             if (Player.Weight() != Player.MaxWeight())
  116.             {
  117.                 Orion.MoveItem(list[i], 0, 'backpack');
  118.                 Orion.Wait(Orion.Random(795,1159));
  119.             }
  120.             else
  121.                 return false;
  122.         }
  123.     }
  124.     Orion.Wait(100);
  125. }
  126.  
  127. function unloadfishinraft()
  128. {
  129.     var caught = Orion.FindType('0x1078|0x1B9B|0x1940|0x0FC5|0x1BEF|0x1B1B|0x1B15|0x1B12|0x1B17|0x1B13|0x0F83|0x0DD6|0x0F7E|0x0F80|0x0F90|0x0F82','-1',backpack);
  130.     var bank = '0x41719781'; // айди сундука
  131.     var bankbag = '0x41876BD1'; // мешок в сундуке куда будем выгружать
  132.     Orion.Wait(500);
  133.     Orion.UseObject(bank);
  134.     Orion.Wait(100);
  135.     for (var i = 0; i < caught.length; i++){
  136.         Orion.MoveItem(caught[i],'-1',bankbag);
  137.         Orion.Wait(Orion.Random(600,1100));
  138.     }
  139. }
  140.  
  141. //--#antimacro
  142. //Какое сообщение смотрит антимакро?
  143. var AMMsg = 'What do you want to use'
  144.  
  145. function abs(i)
  146. {
  147.     if (i < 0)
  148.         return -i;
  149.  
  150.     return i;
  151. }
  152.  
  153. function CompareAntimacroPoints(src, dst)
  154. {
  155.     var delta = 5;
  156.    
  157.     for (var i = 0; i < src.length; i++)
  158.     {
  159.         if ((abs(src[i][0] - dst[i][0]) > delta) || (abs(src[i][1] - dst[i][1]) > delta))
  160.             return false;
  161.     }
  162.    
  163.     return true;
  164. }
  165.  
  166. function Antimacro(timer)
  167. {
  168.     Orion.Wait(500);
  169.    
  170.     var msg = Orion.InJournal(AMMsg, 'sys', '0', '-1', timer, timer + 500);
  171.  
  172.     if (msg != null)
  173.         return;
  174.  
  175.     var gump = Orion.GetLastGump();
  176.  
  177.     if (gump == null || !Orion.Contains(gump.Text(0), "this numb"))
  178.         return;
  179.  
  180.     var antimacroTable =
  181.     [
  182.         [6, [[377, 128], [391, 131], [368, 129], [362, 139], [370, 143], [378, 148], [355, 146], [375, 157], [350, 156], [360, 161], [368, 167]]],
  183.         [3, [[363, 120], [371, 121], [384, 121], [383, 131], [362, 142], [372, 141], [381, 143], [382, 152], [359, 164], [371, 163], [379, 163]]],
  184.         [2, [[350, 128], [362, 123], [369, 118], [374, 126], [363, 147], [371, 142], [380, 137], [368, 156], [375, 166], [382, 159], [391, 153]]],
  185.         [6, [[364, 127], [370, 118], [357, 140], [362, 148], [371, 141], [380, 137], [368, 156], [387, 145], [373, 166], [383, 159], [392, 153]]],
  186.         [6, [[370, 125], [383, 120], [361, 131], [359, 141], [370, 141], [381, 143], [360, 151], [381, 154], [359, 163], [372, 163], [380, 163]]],
  187.         [9, [[354, 123], [366, 122], [377, 118], [359, 135], [377, 130], [361, 145], [372, 142], [380, 139], [382, 149], [365, 165], [375, 159]]],
  188.         [3, [[349, 132], [360, 125], [366, 121], [374, 127], [365, 150], [374, 143], [379, 137], [386, 145], [378, 166], [384, 159], [393, 154]]],
  189.         [9, [[375, 116], [383, 124], [392, 132], [368, 127], [386, 141], [361, 135], [369, 140], [379, 146], [372, 157], [348, 150], [359, 155]]],
  190.         [3, [[375, 119], [383, 125], [391, 133], [384, 141], [362, 136], [369, 144], [377, 150], [370, 158], [349, 152], [358, 159], [367, 166]]],
  191.         [5, [[362, 120], [370, 120], [381, 121], [360, 132], [360, 143], [370, 141], [381, 141], [381, 152], [361, 162], [369, 163], [381, 164]]],
  192.         [8, [[358, 125], [370, 121], [358, 137], [376, 129], [361, 146], [373, 143], [381, 140], [367, 155], [384, 149], [376, 165], [384, 160]]],
  193.         [5, [[365, 120], [376, 122], [385, 123], [362, 131], [362, 141], [372, 143], [382, 143], [381, 154], [358, 160], [368, 163], [379, 164]]],
  194.         [3, [[370, 117], [380, 121], [390, 127], [385, 138], [362, 137], [370, 142], [381, 146], [374, 155], [350, 157], [362, 162], [372, 164]]],
  195.         [2, [[363, 120], [373, 122], [384, 120], [383, 133], [362, 142], [371, 142], [380, 143], [360, 151], [358, 163], [369, 164], [381, 163]]],
  196.         [5, [[356, 121], [369, 122], [379, 120], [360, 134], [362, 143], [371, 140], [382, 142], [384, 149], [364, 165], [374, 162], [384, 162]]],
  197.         [2, [[354, 127], [366, 123], [375, 120], [377, 130], [362, 147], [372, 142], [380, 139], [366, 157], [369, 166], [376, 163], [388, 159]]],
  198.         [9, [[348, 133], [357, 128], [365, 120], [355, 143], [372, 128], [361, 150], [370, 145], [377, 136], [386, 144], [376, 166], [381, 157]]],
  199.         [9, [[367, 118], [376, 120], [387, 124], [364, 129], [384, 135], [362, 141], [372, 144], [381, 143], [378, 156], [355, 161], [369, 159]]],
  200.         [3, [[348, 131], [356, 123], [365, 118], [371, 125], [360, 148], [369, 143], [378, 134], [385, 143], [372, 164], [381, 158], [392, 153]]],
  201.         [8, [[370, 119], [378, 121], [362, 131], [383, 132], [362, 143], [372, 143], [382, 145], [359, 152], [381, 155], [366, 164], [375, 163]]],
  202.         [5, [[351, 132], [360, 127], [367, 119], [358, 140], [364, 149], [372, 141], [381, 137], [387, 143], [377, 165], [384, 159], [393, 151]]],
  203.         [5, [[370, 120], [377, 123], [389, 128], [364, 129], [360, 138], [371, 141], [381, 147], [377, 156], [353, 160], [363, 164], [371, 166]]],
  204.         [2, [[349, 134], [358, 125], [364, 121], [372, 127], [362, 150], [371, 144], [379, 136], [369, 158], [376, 167], [382, 161], [393, 152]]],
  205.         [2, [[375, 117], [384, 124], [393, 132], [386, 139], [363, 134], [371, 143], [379, 146], [357, 142], [350, 152], [359, 158], [369, 166]]],
  206.         [6, [[362, 130], [366, 118], [358, 139], [365, 148], [371, 140], [380, 134], [371, 156], [387, 142], [379, 164], [385, 157], [394, 151]]],
  207.         [6, [[383, 128], [394, 129], [370, 127], [365, 135], [374, 141], [381, 148], [357, 144], [375, 157], [350, 153], [359, 160], [368, 164]]],
  208.         [6, [[369, 127], [379, 118], [359, 133], [362, 143], [372, 143], [381, 140], [361, 155], [384, 151], [364, 166], [375, 165], [386, 162]]],
  209.         [8, [[355, 128], [364, 120], [354, 140], [371, 128], [360, 147], [370, 141], [379, 136], [366, 156], [383, 143], [378, 163], [386, 157]]],
  210.         [6, [[366, 127], [373, 119], [356, 136], [359, 145], [372, 144], [380, 140], [364, 157], [384, 147], [369, 166], [377, 162], [387, 159]]],
  211.         [5, [[374, 117], [383, 124], [391, 128], [368, 125], [361, 135], [372, 142], [381, 146], [374, 155], [350, 152], [359, 160], [368, 164]]],
  212.         [6, [[376, 127], [385, 123], [362, 129], [361, 139], [372, 143], [380, 145], [360, 149], [379, 156], [356, 160], [368, 162], [376, 164]]],
  213.         [9, [[361, 120], [371, 121], [380, 119], [359, 133], [381, 132], [359, 142], [370, 142], [380, 141], [382, 153], [360, 165], [371, 159]]],
  214.         [8, [[376, 121], [386, 125], [367, 129], [386, 138], [361, 137], [373, 142], [382, 147], [356, 147], [376, 157], [358, 158], [370, 163]]],
  215.         [3, [[366, 117], [376, 120], [388, 123], [384, 133], [361, 139], [371, 142], [381, 145], [378, 154], [356, 161], [365, 162], [377, 165]]],
  216.         [9, [[370, 119], [381, 124], [390, 128], [368, 129], [385, 139], [361, 139], [369, 141], [379, 147], [375, 156], [350, 156], [362, 158]]],
  217.         [8, [[379, 121], [387, 128], [369, 127], [386, 140], [362, 137], [373, 142], [379, 146], [357, 143], [374, 157], [355, 156], [364, 163]]],
  218.         [3, [[353, 127], [361, 124], [372, 119], [376, 128], [361, 145], [371, 144], [381, 137], [384, 147], [371, 165], [380, 161], [388, 156]]],
  219.         [8, [[364, 121], [374, 119], [358, 133], [380, 129], [362, 145], [373, 143], [380, 142], [362, 155], [382, 151], [370, 165], [380, 162]]],
  220.         [8, [[370, 119], [382, 123], [365, 130], [385, 134], [362, 139], [370, 141], [382, 146], [359, 149], [377, 156], [359, 161], [369, 164]]],
  221.         [2, [[367, 120], [376, 120], [387, 125], [383, 135], [362, 141], [370, 143], [381, 144], [359, 149], [355, 162], [366, 164], [375, 167]]],
  222.         [5, [[353, 129], [362, 122], [374, 120], [357, 139], [361, 147], [372, 143], [382, 139], [385, 148], [371, 166], [380, 162], [390, 157]]],
  223.         [3, [[359, 122], [368, 121], [378, 120], [379, 131], [360, 142], [371, 142], [381, 141], [382, 152], [364, 164], [373, 163], [384, 161]]],
  224.         [2, [[356, 124], [369, 122], [379, 119], [379, 130], [361, 142], [372, 142], [381, 142], [361, 155], [363, 165], [375, 164], [386, 161]]],
  225.         [9, [[352, 128], [364, 121], [371, 119], [356, 138], [375, 128], [361, 147], [371, 142], [382, 139], [384, 147], [372, 167], [377, 157]]],
  226.         [2, [[371, 118], [381, 125], [390, 128], [387, 138], [362, 139], [370, 143], [382, 147], [357, 148], [352, 156], [362, 162], [372, 166]]]
  227.     ];
  228.    
  229.     var gumppics = gump.GumppicList();
  230.     var positions = [];
  231.    
  232.     for (var i = 1; i < gumppics.length; i++)
  233.     {
  234.         var words = Orion.Split(gumppics[i]);
  235.         var x = parseInt(words[1]);
  236.         var y = parseInt(words[2]);
  237.        
  238.         positions.push([x, y]);
  239.     }
  240.  
  241.     if (positions.length != 11)
  242.     {
  243.         Orion.Print('Bad gumppics length: ' + positions.length);
  244.         return;
  245.     }
  246.  
  247.     var found = -1;
  248.  
  249.     for (var i = 0; i < antimacroTable.length && found == -1; i++)
  250.     {
  251.         if (CompareAntimacroPoints(antimacroTable[i][1], positions))
  252.         {
  253.             found = antimacroTable[i][0];
  254.             break;
  255.         }
  256.     }
  257.  
  258.     var texts = gump.TextList();
  259.  
  260.     for (var i = 1; i < texts.length; i++)
  261.     {
  262.         if (parseInt(texts[i]) == found)
  263.             gump.Select(Orion.CreateGumpHook(i));
  264.     }
  265. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top