Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Figga

Pages: [1]
1
Orion UO Scripts / Re: Building a Lumberjacking Script
« on: November 05, 2023, 01:11:30 PM »
I am not smart enough to figure out how to access the scripts on this site so I resorted to name calling.

2
Orion UO Scripts / armor manager for pvm
« on: October 26, 2023, 08:40:52 PM »
this is part of my pvm bot. responsible for the repair of armor. it may be useful to someone . in this form, the script repairs the armor, after that, he goes into an endless cycle where he checks the durability of the weapon and repairs it.
there is also a function to check the durability of armor and repair damaged REPAIT_BROKEN_ARMOR() . BUT you need to call this function separately from your code

 works for a warrior with metal armor . for leather armor , you will need to slightly change the BOT_armor_REP function( serial , repait_tool_TYPE, Color )

to start script, run the function  ARM . after that , the script will check the availability of the armor. will repair the armor and through the Journal will track the breakdown of the weapon and repair it if necessary

 This script is configured for the      -= REMOVED LINK  =-     server and Checking the durability through the Journal. perhaps you can do it better on your server


functions of the script :
          ARM()  -     main function with variable initialization
          BOT_DRESS_INIT(SET_NAME)    -   DRESS sorting   (need for choose the right repair tools)   
          REPAIR_ALL()      -   repair ALL
          REPAIT_BROKEN_ARMOR()       - repair broken armor   (ONLY ARMOR)      variables -   armor_dur_toREPAIT And  rags_dur_toREPAIT
          PlateArm_CHECK()   - checkinf for missing armor parts
          EQUIP_damg_scan   -INFINITE LOOP to check for weapon damage

Code: [Select]


// This script is configured for the      -=  https://oldp.net/  =-     server
// Checking the durability through the Journal. perhaps you can do it better on your server


// THIS SCRIPT REPAIR ONLY WEAPON !!!!!!!!
// For checking the durability of ARMOR and repairing damaged  REPAIT_BROKEN_ARMOR() . you need to call this function separately from your code


// YOU NEED CHANGE THIS VARIABLES!!!!!!!!!!
//  SET_NAME
// armor_dur_toREPAIT
// rags_dur_toREPAIT
// MAX_DAMAGE     


 //        REPAIR_ALL()                          -   repair ALL
//         REPAIT_BROKEN_ARMOR()       - repair broken armor   (ONLY ARMOR)      variables -   armor_dur_toREPAIT And  rags_dur_toREPAIT
//         PlateArm_CHECK() - checkinf for missing armor parts (precautions before starting the bot)
//         EQUIP_damg_scan()       -INFINITE LOOP to check for weapon damage and REPAIR (inFINITE LOOP !!!!)

   

function ARM()
{
//=============================ARMOR SETS  ==============================
//одно имя для нескольких работающих скриптов приведет к большим проблемам

//enter the name of   all your clothes and weapons SET in the variable SET_NAME
var SET_NAME = "-=NAME_OF_YOUR_SET=-";     //*******************************

// MAX durability of ARMOR before need repair
var armor_dur_toREPAIT = 32;   //  for metal armor*******************************
var rags_dur_toREPAIT = 12;      //  for textil armor********************************




var axe = Orion.ObjAtLayer(1);
var d = check_DUR_f(axe.Serial());

var MAX_DAMAGE = 2;   // MAX damage to repair WEAPOT    **********************
if (d[2] ==="100" ) MAX_DAMAGE = 4; //if weapon have 100 maxdurab   =>  repair after evry 4 damage
if (d[2] ==="50" ) MAX_DAMAGE = 2;  //   or after 2
Orion.Say("weapon repair after" +  MAX_DAMAGE + "dam");





   //Сreates different sets for textiles and metal    and ignores jewelry
var BOT_ALL_ARMOR_SET = "BOT_ALL_ARMOR_SET";     //сет совсем шмотом
var BOT_METEL_ARMOR_SET = "BOT_METEL_ARMOR_SET";   //for REPAIR TOOL
var BOT_RAGS_ARMOR_SET = "BOT_RAGS_ARMOR_SET";       //for REPAIR SEWING KIT
var BOT_ARM_SET = "BOT_ARM_SET";                                   //WEAPON


//Orion.UnsetArm(BOT_ALL_ARMOR_SET);
Orion.SetArm(BOT_ALL_ARMOR_SET);
var temp1 = Orion.GetDressList (BOT_ALL_ARMOR_SET);
Orion.SetDress(BOT_ALL_ARMOR_SET);
var temp2 = Orion.GetDressList (BOT_ALL_ARMOR_SET);
var temp3 = temp1.concat(temp2);
Orion.SetDressList (BOT_ALL_ARMOR_SET, temp3);    //push all armor and weapon to 1 list



var PlateArm_obj =[ 
   Orion.ObjAtLayer(1),
   Orion.ObjAtLayer(2),
   Orion.ObjAtLayer(6),
   Orion.ObjAtLayer(7),
   Orion.ObjAtLayer(10),
   Orion.ObjAtLayer(13),
   Orion.ObjAtLayer(19),
   Orion.ObjAtLayer(24)
];

var all_Arm_obj = [];
var all_Arm_ser = [];
var all_Arm_name = [];
var all_Arm_dur =[];

var armor = [];
var weapot = [];
var rags = [];





BOT_DRESS_INIT(SET_NAME) ;       // DRESS sorting
PlateArm_CHECK() ; // CHECK for missing armor BEFORE start BOT
REPAIR_ALL( );                                 //  Repair all amunition before start


//REPAIT_BROKEN_ARMOR();
EQUIP_damg_scan();    //  INFITE LOOP  for checking weapon damage







msgg = [ " Your Glory War Axe crafted by Dante-dmc (Monster Slayer +19) may have been damaged",
"You damage the Plazma Heater Shield crafted by Figga",
   "You damage the  Platemail ",
"Gold Platemail Arms crafted by Figga",
"[Durability: 20/40]",
"You must have 11 Titanium Ingot to repair Titanium War Axe",
"*You repaired"

  ];
   
//PlateArm_INIT();
//Orion.SetDressList (BOT_ALL_ARMOR_SET, PlateArm_ser);


// WEapon repair MIN DURAB ======================================

//BOT_armor_REP(axe.Serial());
//Armor_repait();




// var shield = Orion.ObjAtLayer(2);
//var ser =   axe.Serial();
// Orion.Click(ser);    
// Orion.Info (ser); 



function REPAIR_ALL()
{
//BOT_DRESS_INIT("SET_NAME")
var armor_list  = Orion.GetDressList (BOT_METEL_ARMOR_SET)
for (i = 0; i < armor_list.length; i ++)
{
BOT_armor_REP(armor_list[i], "0x1865", "0x0000");
}

armor_list  = Orion.GetDressList (BOT_RAGS_ARMOR_SET)
for (i = 0; i < armor_list.length; i ++)
{
BOT_armor_REP(armor_list[i], "0x0F9D", "0x0032");
}
armor_list  = Orion.GetDressList (BOT_ARM_SET)
for (i = 0; i < armor_list.length; i ++)
{
BOT_armor_REP(armor_list[i], "0x1865" , "0x0000");
}

return;
}


function BOT_DRESS_INIT( name )
{

var SHMOT = Orion.GetDressList (name);
if(SHMOT.length === 0) { ARMOR_ERROR();}

for (i = 0; i < SHMOT.length; i ++)
{
var obj =  Orion.FindObject( SHMOT[i]) ;
var layer = obj.EquipLayer();

//============= WAPON  =============
if ( ( layer  == 1  ) || ( layer  == 2  ))
{ weapot.push(SHMOT[i]);  continue; }
//============= ignore RINGs =============
if  (( layer  == 8  ) || ( layer  == 9  ) || ( layer  == 18  ) || ( layer  == 14  ) )
{ continue; }
//=============SHOES ' Ы =============
if  ( layer  == 3  )
{
rags.push(SHMOT[i]);
continue;
}
//============= Textil   =============
if  (( layer  == 20  ) || ( layer  == 22  ) || ( layer  == 23  ) || ( layer  == 12  ) || ( layer  == 17  ))
{
rags.push(SHMOT[i]);
continue;
}
//============= ARMOR  =============
if (layer)   //else armor
armor.push(SHMOT[i]);
}


Orion.SetDressList (BOT_METEL_ARMOR_SET, armor);
Orion.SetDressList (BOT_RAGS_ARMOR_SET, rags);
Orion.SetDressList (BOT_ARM_SET, weapot);


var temp = armor;
temp = temp.concat(rags);
temp = temp.concat(weapot);
Orion.SetDressList (BOT_ALL_ARMOR_SET, temp);  //dress list without  inored items  (rings)

for (i = 0 ; i < temp.length; i ++)
{
obj = Orion.FindObject(temp[i]);
all_Arm_obj[i] = obj;
all_Arm_name [i] = obj.Name();
//all_Arm_dur[i] = check_DUR(temp[i]) ;
}


return ;
}




   
function PlateArm_CHECK()
{


for (var i = 0; i < PlateArm_obj.length; i ++)
{
if (!PlateArm_obj[i] )
{
TextWindow.Open();
TextWindow.Print ('-=============NOT ALL PLATMAIL ARMOR FOUND==============-');
TextWindow.Print ('-==================SCRIPT PAUSED=====================-');
TextWindow.Print ('-===== You can delete  PlateArm_CHECK() or change  PlateArm_obj[] =====-');

Orion.PauseScript();
}   
}

return ;
}

function EQUIP_damg_scan()
{
var dam = 0;
while (true)
{
var xz = Orion.GetDressList(BOT_ARM_SET);

if (Orion.ObjAtLayer(1) != Orion.FindObject(xz[0]) )
{
//Orion.Say (' \n .arm');   //                                    ARM!!!!!!!!!!!!!!!!!!
Orion.Equip(xz[0]);
Orion.Wait(300);
}



Orion.Wait(500);
if (Orion.InJournal("may have been damaged"))
{
Orion.ClearJournal();
dam++;
if (dam >= MAX_DAMAGE )
{
var is_ok = BOT_armor_REP(xz[0], "0x1865", "0x0000");

if (!is_ok )
{
is_ok = BOT_armor_REP(xz[0], "0x1865", "0x0000");
if (!is_ok )
{
TextWindow.Print ('-======!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!========-');
TextWindow.Print ('-======!!WEAPON REPAIR PROBLEM!!========-');
TextWindow.Print ('-======!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!========-');
Orion.CloseUO();
}
}
dam = 0;
Orion.Equip(xz[0]);
}
}
}



return ;
}


}

function ARMOR_ERROR()
{

TextWindow.Open();
TextWindow.Print ('-======!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!========-');
TextWindow.Print ('-======ARMOR SET NOT FOUND!!!!!!!========-');
TextWindow.Print ('-======!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!========-');
// Orion.PauseScript();


}




function BOT_armor_REP( serial , repait_tool_TYPE, Color )
{

var ser = serial;
var obj = Orion.FindObject(ser);
Orion.ClearJournal();



//=============снятие ШМОТКИ!!===================
Orion.Unequip(obj.EquipLayer());
Orion.Wait(700);


var tt = Orion.Now() +5000;
while (true )
{
Orion.Wait (100);
obj = Orion.FindObject(ser);
var my_backpad = Orion.FindObject(backpack).Serial();
if  (obj.Container()  === my_backpad)
{
break;
}

if (tt < Orion.Now())
{
TextWindow.Open();
TextWindow.Print ( obj.Container() + "      "   + my_backpad);
return 0;
}

}

repTool = Orion.FindType(repait_tool_TYPE, Color, 'backpack');
Orion.UseObject(repTool[0]);
Orion.WaitTargetObject(ser);

Orion.Wait (400);

if  (Orion.InJournal ("You must have ", "sys") )
{
TextWindow.Open();
TextWindow.Print ('-==============NO MATERIAL FOR REPAIR==================-');
TextWindow.Print ('-==================SCRIPT PAUSED=====================-');
return 0;
}


//=============одевание ШМОТКИ!!===================
Orion.Equip(ser);


var tt = Orion.Now() +5000;
while (true )
{
Orion.Equip(ser);
var layer = obj.EquipLayer();
if (Orion.ObjAtLayer(layer) && Orion.ObjAtLayer(layer).Serial() === ser )
{
break;
}
Orion.Wait (100);
if (tt < Orion.Now())
{
TextWindow.Open();
TextWindow.Print ("CAN'T WEAR !!!!!  " + layer + "    " + Orion.ObjAtLayer(layer));
return 0;
}
}

return 1;
}





 function check_DUR( serial )
{
    var serr = serial;  //id of item
Orion.ClearJournal();
Orion.Click(serr);
var msgg = Orion.WaitJournal ("Durability", (Orion.Now() - 3000) , (Orion.Now() + 3000), "", serr);
//var dur = parseInt(msgg.Text().substring(13, 21)) ;
var dur = msgg.Text().substring(13, 21)
//var ddur = dur.split(/(  \/ | \] \[  )/) ;

var ddur = dur.split( /(\/|: |])/ ) ;

//TextWindow.Open();  //test !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//TextWindow.Print(Orion.FindObject(serr).Name() + "  =   " + ddur);
    //TextWindow.Print(dur);
//PlateArm_dur[iii] =  dur;
   
return ddur[0] ;
}

 function check_DUR_f( serial )
{
    var serr = serial;  //id of item
Orion.ClearJournal();
Orion.Click(serr);
var msgg = Orion.WaitJournal ("Durability", (Orion.Now() - 3000) , (Orion.Now() + 3000), "", serr);
var dur = msgg.Text().substring(13, 21)
var ddur = dur.split( /(\/|: |])/ ) ;
return ddur;
}


function info()
{
Orion.Info();


}

3
Orion UO Scripts / begging
« on: October 18, 2023, 12:26:38 PM »
ADMINS GIVE ME ACCESS TO DOWLOADING FILES !!!
I don't want to write a humiliating introduction to access the download of all files.  instead, I'd rather publish a script for begging.

The script works in Britain. He runs along pre-set coordinates and looks for sellers. On my server , skill begging does not work on all NPCs .. therefore, search by ID. You will have to enter sellers ID of your server.

Code: [Select]
//*************  configured for https://oldp.net/index.php  ********
//      begging in BRITANIA
//      for correct work on your server, enter the seller's ID and, if necessary, change the route coordinates

function LUMPIN()
{
// id of vendors for begging **************************************

vendor_arr = ["0x0008E2BB" , "0x0008C061" , "0x0008E10D" , "0x0008C039" , "0x0008CB16" , "0x0008E13E" , "0x0008E156" , "0x0008D03F" , "0x0008E14C" , "0x0008B2E3" , "0x0008E2C7" , "0x0008C1A1" , "0x0008E283" , "0x0008E468" , "0x0008E485" , "0x00092FF7" , "0x0008B78A" , "0x0008D192" , "0x0008E4C6" , "0x0008E4D4" , "0x0008D188" ,
"0x0008D299", "0x0008C32C", "0x0008D3DE", "0x0008C556", "0x0008D3F3" , "0x0008D292" , "0x0008C1E5" , "0x0008E693" , "0x0008E66E" , "0x0008D42A" ,  "0x0008E642" , "0x0008E659" , "0x00065819" , "0x0008C4B9" , "0x0008C4C4"

];


waitVendor_arr = [  ] ;
for (var i = 0; i < vendor_arr.length; i++)
{
waitVendor_arr[i] = 0;
}


Orion.SetBadLocation(1453, 1695);   //teleport coord
Orion.SetBadLocation(1488, 1586);




//   run around city and try find vendors     *******************************
find_ven();
Orion.WalkTo (1432 ,1734,20, 1);
find_ven();
Orion.WalkTo (1462,1697,0, 1);
find_ven();
Orion.WalkTo (1492,1682,20, 1);
find_ven();
Orion.WalkTo (1472,1606,20, 1);
find_ven();
Orion.WalkTo (1434,1573,30, 1);
find_ven();
Orion.WalkTo (1492,1572,30, 1);
find_ven();
Orion.WalkTo (1487,1638,20, 1);
find_ven();








function find_ven()
{
for (var a = 0; a < vendor_arr.length; a++)
{

if ( waitVendor_arr[a] < Orion.Now() )
{
var res =Orion.FindObject(vendor_arr[a]);
if (res)
{

Orion.Say('test' + a);
var ser = res.Serial();
Orion.ClientLastTarget(ser);
Orion.TargetSystemSerial(ser);

Orion.WalkTo(res.X(), res.Y(), res.Z(), 1);
Orion.Follow(ser);
scanJ();
waitVendor_arr[a]  =  Orion.Now() +900000;  //15 min dont toch this vendor
}
else
{   TextWindow.Open();    //Test print
TextWindow.Print(vendor_arr[a]);
TextWindow.Print(a);
}
}
else TextWindow.Print( Orion.Now() - waitVendor_arr[a] );
}
}
 
function scanJ ()
{

msgs = ['Begging ended' ,
  'Of course,' ,
  'You put the gold coin'  ,
  'Oh, I have no money now|You must wait to use that' ,
  'You are already begging' ,
  'is too far away' ,
  'You must wait to use that' ,
  'You can use this skill only on humans' ,
  'with thoughts of battle'
];
Orion.ClearJournal();
Orion.JournalIgnoreCase(true );
Orion.UseSkill('Begging' );
Orion.WaitTargetObject(Orion.ClientLastTarget() );

var tim = Orion.Now() + 50000 ;
while (tim >Orion.Now() )
{
Orion.Wait(1000);
//Orion.Say('xz');

if (Orion.FindObject(self).X() > 2000 )  //teleported BY mistake
{
TextWindow.Open();
TextWindow.Print('-==========PISEC==========-');
Orion.WalkTo(4413 ,1144, 0, 0);  //go back to teleport
}

if ( Orion.InJournal(msgs[7])      )   //wrong Target (ONLY VENDORS)
{
Orion.Say('netot');
break;
}
if ( Orion.InJournal(msgs[3])      )     // target need rest
{
Orion.Wait(1000);
Orion.Say('thenx');
Orion.ClearJournal();
break;
}
if (Orion.InJournal(msgs[0]) ) // try one more time
{
Orion.Say('dEngi daVaj');
Orion.UseSkill('Begging' );
Orion.WaitTargetObject(Orion.ClientLastTarget() );
Orion.ClearJournal();
var tim = Orion.Now() + 50000 ;
continue;
}
if (Orion.InJournal(msgs[5]) ) // try one more time
{
var tar = Orion.FindObject ( Orion.ClientLastTarget() );
Orion.WalkTo(tar.X(), tar.Y(), tar.Z(), 1);

Orion.Follow(Orion.ClientLastTarget());
Orion.UseSkill('Begging' );
Orion.WaitTargetObject(Orion.ClientLastTarget() );
Orion.ClearJournal();
var tim = Orion.Now() + 50000 ;
continue;
}


}
Orion.Wait(1000);
Orion.Say('goodbye');
}





}








function ViewRangNORM()
{
Orion.ClientViewRange(20);
//Orion.Say(Orion.ClientViewRange()  );
Orion.Info();
}

Pages: [1]