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.


Topics - Blacklisted

Pages: [1] 2
1
Stealth Client / How to debug C# scripts with Visual Studio
« on: May 12, 2019, 03:21:13 AM »
Hi, does anyone know how I can debug scripts using c# when they are running n stealth? I was using a try catch and outputing the string to a listbox.
I have an issue where the .exe is crashing before it can write anything to the list box.

how do I debug c# while using stealth.

2
Scripting Chat / Cross Healer
« on: February 13, 2018, 11:40:08 AM »
I've been playing on freeshard with a pretty low population, there is not enough people around to do spawns peerless, etc. so finding it hard to get 120s or farm mats to imbue with to make a better suit.
Does any one know of a script that I could run on one character that would heal/cure my main character.?

3
Stealth Client / C# open gump
« on: February 10, 2018, 12:53:03 PM »
I started playing UO again and I was thinking of automating the buying of regs from NPC vendors by gating around to mages shops.
I've been looking at the c# examples but cant firgure out how to open gumps can any other a small code snippet to get me started.

I've been trying to get a list of the NPC's in luna mage shop then double click on each one.
The Mobile is expecting a uint but I cant find where to get the value all the values in stealth are the wrong type


Code: [Select]
class Program
    {
        public static List<Mobile> lunaMageShopNpcs;
       
        public static Gump shopGump;     

        static void Main(string[] args)
        {
            lunaMageShopNpcs.Add(new Mobile(00000B08));
            lunaMageShopNpcs.Add(new Mobile(00000B0B));
            lunaMageShopNpcs.Add(new Mobile(00000B0A));
            lunaMageShopNpcs.Add(new Mobile(00000B0C));
           
            foreach (Mobile mobile in lunaMageShopNpcs)
            {
                mobile.DoubleClick();
                Console.WriteLine(mobile.Name);
                Console.WriteLine(mobile.Location);
            }
        }
    }

thanks.

4
Script Debug / Bod turn in reward gump
« on: May 12, 2017, 12:25:00 PM »
I have writen a script to turn in BOD's to the Blacksmith however at the moment it is just clicking the save reward points then it moves on and gets a new BOD then turns in a filled one.

I've been trying to figure out a way to grab the value of the points to then determine if not to save the points or spend them on say POF.

I cant see the reward points value anywhere in the journal, anyone any ideas how I can grab that reward pont value?




5
Stealth Snippets\Library / Cant determine if target is dead
« on: June 11, 2016, 09:02:36 AM »
I am trying to check if a target is dead or not. but the target value always return true.
Im not sure if I am using the TargetHelper class correctly or not.

Code: [Select]
namespace Test
{
    public partial class MainWindow : Window
    {
        public PlayerMobile Player = PlayerMobile.GetPlayer();
        public TargetHelper TargetHelper = TargetHelper.GetTarget();
        private Thread TestThread;
        public MainWindow()
        {
            InitializeComponent();
            TestThread = new Thread(TestIfDead);
        }

        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            TestThread.Start();
        }

        public void TestIfDead()
        {
            var target = TargetHelper.VCursorToMobile();
            do
            {
                if (target.Dead)
                {
                    this.Dispatcher.Invoke((Action)(() =>
                    {
                        tbIsDead.Text = "TARGET DIED";
                    }));
                   
                }
                else
                {
                    this.Dispatcher.Invoke((Action)(() =>
                    {
                        tbIsDead.Text = "TARGET ALIVE";
                    }));
                }
            } while (!target.Dead);
        }
    }
}

6
Stealth scripts / Looting error Queue Empty
« on: June 08, 2016, 11:20:57 AM »
****I posted in the wrong section can it be moved*****

I've been trying to code a script to loot gold from corpses.
I am getting the error Queue Empty at what seems to be very random times so I was thinking would lag be affecting it some way.
I am not using Queues tho just lists so should I even be seeing that error. Anyone see what might be wrong.
the code falls on the line

Code: [Select]
var corpses = Item.Find(typeof(Corpse), 0x0, false);

Code: [Select]
public  void StartLooting()
        {
            List<Item> lootItems = new List<Item>();
            Thread.Sleep(500);
            
            try
            {
                while (Looting)
                {
                    var corpses = Item.Find(typeof(Corpse), 0x0, false);
                    if (corpses.Count > 0)
                    {
                        foreach (Corpse corpse in corpses)
                        {
                            if (corpse.Distance < 4)

                            {
                                corpse.DoubleClick();
                            }                            

                            Thread.Sleep(500);

                            var goldList = Item.Find(typeof(Gold), corpse.Serial.Value, false);

                            foreach (Gold gold in goldList)
                            {
                                lootItems.Add(new Loot(gold.Serial));
                            }

                            if (lootItems.Any())
                            {
                                foreach (Item loot in lootItems)
                                {
                                    loot.MoveItem(Player.Backpack);
                                }
                            }
                            Looting = false;
                            Thread.Sleep(500);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                this.Dispatcher.Invoke((Action)(() =>
                {
                    Clipboard.SetText(e.StackTrace);
                    listBox.Items.Clear();
                    listBox.Items.Add(e);
                }));                
            }
        }

Here's the stack trace.

Code: [Select]
  at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Queue`1.Dequeue()
   at StealthAPI.StealthClient.WaitReply[T](PacketType type)
   at StealthAPI.StealthClient.SendPacket[T](PacketType packetType, Object[] parameters)
   at StealthAPI.Stealth.FindTypeEx(UInt16 objType, UInt16 color, UInt32 container, Boolean inSub)
   at ScriptSDK.Engines.Scanner.<>c__DisplayClass23_2`1.<Find>b__2(UInt32 le)
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__22`3.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
   at ScriptSDK.Engines.Scanner.Find[T](List`1 Graphics, List`1 Colors, List`1 Locations, Boolean SubSearch)
   at ScriptSDK.Items.Item.Find(Type type, List`1 Locations, Boolean SubSearch)
   at ScriptSDK.Items.Item.Find(Type type, UInt32 Location, Boolean SubSearch)
   at AutoLoot.MainWindow.StartLooting() in C:\Users\GreyWalker\Desktop\UOStuff\Projects\AutoLoot\MainWindow.xaml.cs:line 58

7
Stealth Client / C# how to determine if buff is active
« on: June 04, 2016, 06:05:28 AM »
I am trying to cast Divine Fury only if the buff Consecrate Weapon is Active.
However the buff is always set to false.

I understand that this is because im setting cwBuff to false using

Code: [Select]
Buff_DebuffSystemEventArgs cwBuff = new Buff_DebuffSystemEventArgs(44878, 1082, false);

Whats the proper way of handing buff events? I've had a look at the API but cant find any examples

Code: [Select]
public void AttackRoutine()
{
      Buff_DebuffSystemEventArgs cwBuff = new Buff_DebuffSystemEventArgs(44878, 1082, false);
      var spellname = string.Empty;
      do
      {
           if (player.WarMode)
           {
               if (cwBuff.IsEnabled)
               {
                    spellname = "Divine Fury";
                    player.Cast(spellname);
                    response(spellname, player.Name);
                    Stealth.Client.Wait(1000);
                }
                else
                {
                   spellname = "Consecrate Weapon";
                   player.Cast(spellname);
                   response(spellname, player.Name);
                   Stealth.Client.Wait(1000);
                }
            }
       } while (!player.Dead)
}



8
Stealth Client / Getting Disconnected(Duplicates are not allowed)
« on: May 31, 2016, 02:38:35 PM »
i am trying out some simple code to cast consecrate weapon but I keep getting disconnected after the second cast of the spell with the message "Duplicates are not allowed"

The call stack shows

Code: [Select]
An exception raised at 23:33:40:611
Duplicates not allowed
(00882C80){Stealth.exe } [00C83C80] ClassCharacter.{System.Generics.Collections}TDictionary<System.Word,ScriptTypes.TBuffIcon>.Add (Line 1846, "System.Generics.Collections.pas")
Call stack:
  (00882C7B){Stealth.exe } [00C83C7B] ClassCharacter.{System.Generics.Collections}TDictionary<System.Word,ScriptTypes.TBuffIcon>.Add (Line 1844, "System.Generics.Collections.pas")
  (008794F9){Stealth.exe } [00C7A4F9] ClassCharacter.TCharacter.GetInfoFromPacket_0xDF (Line 10422, "ClassCharacter.pas")
  (0086DA48){Stealth.exe } [00C6EA48] ClassCharacter.TCharacter.RedirectGamePacket (Line 6457, "ClassCharacter.pas")
  (0086BF8E){Stealth.exe } [00C6CF8E] ClassCharacter.TCharacter.GameClientOnRead (Line 5863, "ClassCharacter.pas")
  (002CCE91){Stealth.exe } [006CDE91] System.Win.ScktComp.TCustomSocket.Event (Line 1903, "System.Win.ScktComp.pas")
  (002CB42E){Stealth.exe } [006CC42E] System.Win.ScktComp.TCustomWinSocket.Event (Line 1013, "System.Win.ScktComp.pas")
  (002CBA09){Stealth.exe } [006CCA09] System.Win.ScktComp.TCustomWinSocket.WndProc (Line 1201, "System.Win.ScktComp.pas")
  (000D5CAC){Stealth.exe } [004D6CAC] System.Classes.StdWndProc (Line 16600, "System.Classes.pas")

Here's my code but I cant figure out whats wrong

Code: [Select]
class Program
    {
        static void Main(string[] args)
        {
            PlayerMobile player = PlayerMobile.GetPlayer();
            int hp = player.Hits;

            var spellname = string.Empty;
            var delay = 0;
            do
            {
                if (player.WarMode)
                {
                    if (player.Mana > 35 && hp > 35)
                    {
                        spellname = "Consecrate Weapon";
                        player.Cast(spellname);
                        delay = 4000;
                        Stealth.Client.Wait(delay);
                    }
                }
            } while (!player.Dead);
        }
    }

9
Stealth archive / Freeshard Login
« on: May 17, 2014, 06:41:11 PM »
Hi guys Ive started playing UO again on a freeshard and ive been wanting to write some C# scripts.
However I am unable to login to the shard using Stealth, I keep getting the incorrect login message.
the freeshard uses UOSteam to connect and easyuo wont work on the shard either.

would anyone be so kind as to try and login using steam so I can check if its me thats doing something wrong in configuring the stealth client

thanks

uo.dysentria.com port 5003

10
Script Debug / Rail Problem
« on: August 16, 2011, 06:00:00 AM »
I'm having a drama with a rail i've wrote using ENs - Subs - MiniRail System
I have recorded right up to the hole but the character will stop just a couple of tiles before he reaches the hole and spams "can't get there".
any ideas whats causeing the issue?




This is the code i have to move to that hole.

Code: [Select]
;--------------------------------------------------------------
sub ENs_FindHole2
  If %Hole2LoopValueMax = N/A
    gosub SetupHole2LoopValues
  set !holefound #False
  set !Loopvalue 0
  repeat
    gosub hole2move !loopvalue
    if !loopvalue > 10
    {
    gosub findhole2
    }
  until #result   ; hole found


; finish the loop.
;  repeat
;    gosub hole2move !loopvalue
;  Until !loopvalue >= %Hole2LoopValueMAx

wait 15
Return
;--------------------------------------------------------------
;--------------------------------------------------------------
Sub Hole2Move
    set !x %Hole2LoopValuex . %1
    set !y %Hole2LoopValuey . %1
    set !z %Hole2LoopValuez . %1
    set !Exit 20
    Repeat
      set !Exit !exit - 1
      event pathfind !x !y !z
      wait 1
    Until ( #Charposx = !x && #charposy = !y ) || !exit < 1
    set !loopvalue !loopValue + 1
    If !loopvalue >= %Hole2LoopValueMAx
      set !LoopValue 1
Return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub SetupHole2LoopValues
  gosub AddHole2loopvalue 5883 1864 4
  gosub AddHole2loopvalue 5921 1797 0
  gosub AddHole2loopvalue 5921 1797 0
  gosub AddHole2loopvalue 5921 1797 0
  gosub AddHole2loopvalue 5921 1808 1
  gosub AddHole2loopvalue 5921 1808 1
  gosub AddHole2loopvalue 5921 1808 1
  gosub AddHole2loopvalue 5921 1819 2
  gosub AddHole2loopvalue 5921 1819 2
  gosub AddHole2loopvalue 5921 1819 2
  gosub AddHole2loopvalue 5921 1834 3
  gosub AddHole2loopvalue 5921 1834 3
  gosub AddHole2loopvalue 5921 1851 1
  gosub AddHole2loopvalue 5921 1851 1
  gosub AddHole2loopvalue 5921 1851 1
  gosub AddHole2loopvalue 5915 1861 3
  gosub AddHole2loopvalue 5915 1861 3
  gosub AddHole2loopvalue 5908 1872 4
  gosub AddHole2loopvalue 5908 1872 4
  gosub AddHole2loopvalue 5908 1872 4
  gosub AddHole2loopvalue 5904 1876 2
  gosub AddHole2loopvalue 5904 1876 2
  gosub AddHole2loopvalue 5900 1872 0
  gosub AddHole2loopvalue 5900 1872 0
  gosub AddHole2loopvalue 5897 1875 0
  gosub AddHole2loopvalue 5897 1875 0
  gosub AddHole2loopvalue 5897 1875 0
return
;--------------------------------------------------------------
;--------------------------------------------------------------

sub AddHole2LoopValue
  if %Hole2LoopValueMAx = N/A
     set %Hole2LoopValueMax 0
  set %Hole2LoopValueMax %Hole2LoopValueMax + 1
  set %Hole2LoopValuex . %Hole2LoopValueMax   %1
  set %Hole2LoopValuey . %Hole2LoopValueMax   %2
  set %Hole2LoopValuez . %Hole2LoopValueMax   %3
Return
;--------------------------------------------------------------
;--------------------------------------------------------------
;--------------------------------------------------------------

11
Scripting Chat / Client Swoping and EUO
« on: August 14, 2011, 12:35:48 AM »
Somtimes when I have two clients runnning I hit the UOXL SWAP button i can never be sure its actully swopped over
time and time again I've clicked that button then hit play on a script to see its not swaped over.
is there a way tell what clent EUO is currently attached to before hitting the paly button ?

12
Script Debug / Choppy movment with rail
« on: August 13, 2011, 04:35:26 AM »
Hi

After finishing my Move Loot script.... with some help. I decided to make a script that would farm Bags of sending for me..
I wrote down what I wanted the script to do.

Setup cantainers
recall to ant hole
enter hole
move to next hole
enter hole 2
move to hole 3
enter hole 3
find ambitious queen
talk to ambitious queen
accept quest
move to queen spawn spot

REPEAT
kill queen
avoid acid on the ground
loot queen
UNTIL 5 queens are killed

return to ambitions queen
talk to ambitious queen
drop 50 zoogie on ambitious queen

talk to queen
accept quest
and so on untill nearly at weight limit
return to bank

I read another post on the site of a user that had manged to write a script that farms the "Powder of Translocation" and took some ideas from whats available in his post.
the post can be found here http://www.scriptuo.com/index.php?topic=3004.0;highlight=powder

So far I am able to set up the secure containers and use either recall or sacred journey to get to the anthole.
but when i enter the ant  hole the rail movment is very choppy the character will take a couple of steps and spam pathfinding and cant get there then take another couple of steps and spam again
he will move to the second hole but very slowly.

Any ideas how to make the movment more fluid also any criticism on what I have so for would be appreciated taken and positively ?

heres my code

Code: [Select]
;=================================================================
; Script Name: BOS Farmer
; Author: Blacklisted
; Version: 1.0
; Shard OSI
; Revision Date: 12/8/2011
; Purpose: Farm Bags of Sending
; Globals: None
;=================================================================
; Special Instructions: You can put in some of the setup
; and running instructions here. Any disclaimers you want or
; any other information you want the user to know about your
; script. A more detailed Purpose could go here as well. If
; your script is a sub routine, you MUST include how to call
; the sub in this section:

; Thanks: {Endless Night for the rail and enter hole subs, TrailMyx's for the travel subs }
;=================================================================
set %charname #RESULT
set %secure N/A ;bag inside your bank to store rewards
set %rewardbag N/A ;bag inside your main backpack to store rewards
set %bankrunebook bank ;named runebook inside your backpack
set %anthole 1 ;position on anthole rune in rune book
set %bankbox 2 ;position of bank rune in rune book
set %travel
;=================================================================



;=================================================================
gosub menu


repeat
if #menubutton = setsecure_button
   {
   gosub setsecure
   set #menubutton N/A
   }
if #menubutton = setrewardbag_button
   {
   gosub setrewardbag
   set #menubutton N/A
   }
menu get travelmethodbox
if #menures = 1
   {
   set %travel RE
   }
if #menures = 2
   {
   set %travel SJ
   }
if #menubutton = start_button
   {
   gosub TM_AddUnderscore #CHARNAME
   gosub TM_TravelFromNamedRunebook %travel %anthole %bankbox %bankrunebook
   gosub ENs_EnterAntHole1
   gosub ENs_FindHole2
   gosub ENs_findAntQueen
   set #menubutton N/A
   }
until #false



;===================================================================

;=====Sub set secure ===============================================
sub setsecure
event SysMessage Target your secure bag
event Macro 3 0 Bank
set #targcurs 1 ;sets the little target cursor on
      while #targcurs = 1 ; while #targcurs = 1, so while the target cursor is on, it will wait
      wait
      set %secure #ltargetid ; once the bag is clicked, we will set it's id
      set #lobjectid #ltargetid ; here we will set the last object to the id of the last target, in this case, our loot bag
      event macro 17 ; event macro 17 is 'Use Last Object', so this will open our loot bag
      menu Edit EUOEdit1 100 44 57 %secure
      wait 20
      set #contPosX 10
      set #contPosY 600
return
;=====End Sub=======================================================



;=====Sub set secure ===============================================
sub setrewardbag
event SysMessage Target your reward bag
event Macro 8 7
set #targcurs 1
      while #targcurs = 1
      wait
      set %rewardbag #ltargetid
      set #lobjectid #ltargetid ;
      event macro 17
      menu Edit EUOEdit2 100 72 57 %rewardbag
      wait 20
      set #contPosX 250
      set #contPosY 600
return
;=====End Sub=========================================================



;=====================================================================
; %1 = Method (RE, GA, SJ)
; %2 = Object Findid
; returns #TRUE if error, #FALSE for no error

;----------------------TM travel subs--------------------------
;=====================================================================
; Script Name: TrailMyx's Runebook/Spellcast Subs
; Author: TrailMyx
; Version: 2.5
; Shard OSI / FS: OSI / FS
; Revision Date: 09/27/2007
; Purpose:
;   Runebook subs to manage your runebook travel needs.  You need either to know
;   the runebook ID or runebook name.
;
; Subroutines:
;     TM_NewCastSpell - casts spells with appropriate waits, delays, retrys.
;     TM_TravelFromRunebook - Uses specified runbook #FINDID to travel from .  If a location is blocked
;                             the next location will be tried until success.
;     TM_TravelFromNamedRunebook - Same as TM_TravelFromRunebook, but allows you to specify a runebook name
;
;  Examples:
;     gosub TM_NewCastSpell 31 !rbook 10 20 20 ; recall
;     gosub TM_TravelFromRunebook RE 1 3 %runebookid ; travel (recall) to location from #FINDID runebook using slots 1-3
;     gosub TM_TravelFromNamedRunebook GA 1 2 LUMBERJACKING1 ; gate using LUMBERJACKING1 runebook starting at rune 1
;     gosub TM_RandomRunebookTravel SJ 1 6 %runebookid  ; Randomly choose a rune from 1-6 in runebook
;     gosub TM_TravelFromObject RE %runeid ; travels to rune specified by %runeid
;
;  Use of these subrountes is allowed, but please give me (TrailMyx) credit somewhere in your script.
;
;  Release History:
;     2.0 - Initial public release
;     2.1 - Bug in TM_FindValidTextNoAdvance, added return value to TM_TravelFromNamedRunebook
;     2.2 - Bug in TM_NewCastSpell when mana gets too low
;     2.3 - Better spellcasting for chivalry, necro
;           Added TM_TravelFromNamedRunebook
;           Added TM_RandomRunebookTravel
;     2.4 - Little fix for journal handler
;     2.5 - Hack to allow for transport through a red moongate.
;
;  Requirements:
;
;    This script requires that you have your character name
;    setup in a variable called %charname.  Place this bit of code
;    in your script initialization somewhere:
;
;   gosub TM_AddUnderscore #CHARNAME
;   set %charname #RESULT
; %1 = spell number
; %2 = #TARGETID or SELF or NONE
; %3 = retry count (-1 = cast until successful)
; %4 = cast delay
; %5 = recovery delay
sub TM_NewCastSpell
  namespace push
  namespace local NCS
  set !lpc #LPC
  set #LPC 100
  set !whichspell %1
  set !whichtarget %2
  set !castretrymax %3
  set !waitdelay %4
  set !recovery_delay %5

  set !castretry 0
  set !temp_ltargetid #LTARGETID
  set !temp_ltargetkind #LTARGETKIND

  NewCastSpell_loop1:
    if !castretrymax < 0
      goto NewCastSpell_cont1
    if !castretry > !castretrymax
      goto NewCastSpell_end1
    NewCastSpell_cont1:
      gosub TM_SyncTextScan
      set #LTARGETKIND 1
      set #LTARGETID !whichtarget
      set !tempmana #MANA
      event macro 15 !whichspell ; cast the spell
      wait !waitdelay
      set !targettimeout #SCNT + 7
      NewCastSpell_wait1:
        gosub TM_FindValidTextNoAdvance spell_fizzles you_have_not_yet mana your_spirit more_reagents
        if #RESULT = #TRUE || #SCNT > !targettimeout
        {
          set !casttimeout #SCNT2 + !recovery_delay
          repeat
          until #SCNT2 > !casttimeout     ; finish up cast delay
          set !castretry !castretry + 1
          goto NewCastSpell_loop1
        }
        if !whichtarget = NONE
          goto NewCastSpell_skip1
        if #TARGCURS = 1
          goto NewCastSpell_targ1
        goto NewCastSpell_wait1 ; wait for target cursor

  NewCastSpell_targ1:
    if !whichtarget = SELF
      event macro 23
    else
      event macro 22

  NewCastSpell_skip1:
    wait 5
    set !casttimeout #SCNT2 + !recovery_delay
    NewCastSpell_skip2:
      if !whichspell >= 0 && !whichspell <= 63 ; Magery
      {
        gosub TM_FindValidTextNoAdvance spell_fizzles there_is_already mana your_spirit more_reagents
      }
      else
      {
        set !cont #FALSE  ; Chivalry, Necromancy, etc
        finditem !whichtarget *
        if !whichtarget in SELF_NONE || #FINDKIND <> -1
          set !cont #TRUE

        if #MANA >= !tempmana && !cont = #TRUE ; check if target is still there
          set #RESULT #TRUE
        else
          set #RESULT #FALSE
      }
      repeat
      until #SCNT2 > !casttimeout     ; finish up cast delay
      if #RESULT = #TRUE
      {
        if !castretrymax > -1
        {
          set !castretry !castretry + 1 ; %castretrymax of -1 will cast until successful
          if !castretry > !castretrymax
            goto NewCastSpell_end1
        }
        goto NewCastSpell_loop1
      }
      if #SCNT2 <= !casttimeout     ; finish up cast delay
        goto NewCastSpell_skip2
  NewCastSpell_end1:
    set #LTARGETID !temp_ltargetid
    set #LTARGETKIND !temp_ltargetkind
    set #LPC !lpc
    namespace pop
return
;-------------------------------------------------------------------------------
; %1 = Method (RE, GA, SJ)
; %2 = index location within runebook (1-16)
; %3 = index location within runebook (1-16), try up to this point
; %4 = runebook item id
; returns #TRUE if error, #FALSE for no error
sub TM_TravelFromRunebook
  namespace push
  namespace local RFR
  set #LTARGETKIND 1
  set !method %1
  set !locindex %2
  set !locindexend %3
  set !rbook %4

  finditem !rbook C_ , #BACKPACKID
  if !method notin RE_GA_SJ || #FINDKIND = -1
  {
    namespace pop
    return #TRUE
  }
  if !locindex notin 1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16
  {
    namespace pop
    return #TRUE
  }
  if !locindexend notin 1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16
  {
    namespace pop
    return #TRUE
  }

  TravelFromRunebook_loop1:
    set #LOBJECTID !rbook
    set #LTARGETKIND 1
    event macro 17 0
    gosub GumpWait generic_gump generic_gump

    set !runeclickx 140 ; page 1, rune 1
    set !runeclickx ( #CONTPOSX + !runeclickx + ( 35 * ( ( !locindex - 1 ) / 2 ) ) )
    if !locindex > 8
    {
      set !runeclickx 310 ; page 2, rune 1
      set !runeclickx ( #CONTPOSX + !runeclickx + ( 35 * ( ( !locindex - 9 ) / 2 ) ) )
    }
    set !runeclicky #CONTPOSY + 196
    click !runeclickx !runeclicky
    wait 5

    set !runeclicky #CONTPOSY + 24
    set !runeclickx #CONTPOSX + 164 ; page 1 set to default
    if !locindex % 2 = 0
    {
      set !runeclickx #CONTPOSX + 305 ; page 2 set to default
    }
    click !runeclickx !runeclicky
    wait 5
    set !oldx #CHARPOSX
    set !oldy #CHARPOSY
    if !method = RE
      gosub TM_NewCastSpell 31 !rbook -1 10 10 ; recall until successful
    if !method = GA
    {
      gosub TM_NewCastSpell 51 !rbook -1 10 20 ; gate until successful
      set !temp_cnt #SCNT + 10
      repeat
        finditem KEF_OTF_JEF G_0
      until #FINDKIND <> -1 || #SCNT > !temp_cnt
      if #FINDKIND <> -1
      {
        set #LOBJECTID #FINDID
        wait 10
        event macro 17 0
        wait 20
        if #CONTNAME = generic_gump && #CONTSIZE = 420_280
        {
          gosub TM_SyncTextScan
          set !clickx #CONTPOSX + 26
          set !clicky #CONTPOSY + 261
          click !clickx !clicky ; click ok
        }
      }
    }

    if !method = SJ
      gosub TM_NewCastSpell 210 !rbook -1 10 30 ; sacred journey until successful
    wait 30

    set !tempscnt #SCNT + 10
  WaitforTravel_loop1:
    gosub TM_FindValidTextNoAdvance location_is_blocked something_is_blocking you_spirit_lacks
    if #RESULT = #TRUE
    {
      gosub TM_SyncTextScan
      set !locindex !locindex + 1
      if !locindex > !locindexend
      {
        namespace pop
        return #TRUE
      }
      goto TravelFromRunebook_loop1
    }
    if ( ( #CHARPOSX = !oldx && #CHARPOSY = !oldy ) && #SCNT < !tempscnt )
      goto WaitforTravel_loop1

  if #CONTNAME = generic_gump && #CONTSIZE = 452_236 ; RunUO close runebook
  {
    set !clickx #CONTPOSX + 120
    set !clicky #CONTPOSY + 60
    click !clickx !clicky mc r
    wait 5
  }
  namespace pop
  click 401 254 n
return #FALSE
;----------------------------------------------------------------------------------
; %1 method
; %2 starting index
; %3 ending index
; %4 runebook name
sub TM_TravelFromNamedRunebook %travel %anthole %bankbox %bankrunebook
  namespace push
  namespace local TFNR
  set !method %1
  set !start_index %2
  set !end_index %3
  set !runbook_name %4
  if !method notin RE_GA_SJ
  {
    namespace pop
    return #TRUE
  }
  if !start_index notin 1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16
  {
    namespace pop
    return #TRUE
  }
  if !end_index notin 1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16
  {
    namespace pop
    return #TRUE
  }
  locatenamedrunebook:
    finditem ZBN C_ , #BACKPACKID
    if #FINDKIND <> -1
    {
      event property #FINDID
      if !runbook_name in #PROPERTY
      {
        gosub TM_TravelFromRunebook !method !start_index !end_index #FINDID ; recall to location
      }
      else
      {
        ignoreitem #FINDID rbook
        goto locatenamedrunebook
      }
    }
    else
    {
      display ok Cannot locate specified runebook named , #SPC , !runbook_name
      stop
    }
  ignoreitem reset rbook
  namespace pop
return
;------------------------------------------------------------------------------------------------------
sub TM_RandomRunebookTravel
  namespace push
  namespace local RRT
  set !travelmethod %1
  set !rune1 %2
  set !rune2 %3
  set !runebook %4
  if !rune1 > !rune2
  {
    set !temp !rune2
    set !rune2 !rune1
    set !rune1 !temp
  }
  RunebookTravel_loop1:
    set !random #RANDOM
    set !rune ( ( !random % ( !rune2 - !rune1 + 1 ) ) + !rune1 )
    gosub TM_TravelFromRunebook !travelmethod !rune !rune !runebook
    if #RESULT = #TRUE
      goto RunebookTravel_loop1
  namespace pop
return
;----------------------------------------------------------------------------------------------------
; %1 = Method (RE, GA, SJ)
; %2 = Object Findid
; returns #TRUE if error, #FALSE for no error
sub TM_TravelFromObject
  namespace push
  namespace local RFR
  set !method %1
  set !object %2

  finditem !object C_ , #BACKPACKID
  if !method notin RE_GA_SJ || #FINDKIND = -1
  {
    namespace pop
    return #TRUE
  }

  set !oldx #CHARPOSX
  set !oldy #CHARPOSY
  TravelFromObject_loop1:
    if !method = RE
      gosub TM_NewCastSpell 31 !object -1 10 10 ; recall until successful
    if !method = GA
    {
      gosub TM_NewCastSpell 51 !object -1 10 20 ; gate until successful
      set !temp_cnt #SCNT + 10
      repeat
        finditem KEF_OTF_JEF G_0
      until #FINDKIND <> -1 || #SCNT > !temp_cnt
      if #FINDKIND <> -1
      {
        set #LOBJECTID #FINDID
        wait 10
        event macro 17 0
        wait 20
        if #CONTNAME = generic_gump && #CONTSIZE = 420_280
        {
          gosub TM_SyncTextScan
          set !clickx #CONTPOSX + 26
          set !clicky #CONTPOSY + 261
          click !clickx !clicky ; click ok
        }
      }
    }

    if !method = SJ
      gosub TM_NewCastSpell 210 !object -1 10 30 ; sacred journey until successful
    wait 30

    set !tempscnt #SCNT + 10
  WaitforTravel2_loop1:
    gosub TM_FindValidTextNoAdvance location_is_blocked something_is_blocking your_spirit_lacks
    if #RESULT = #TRUE
    {
      gosub TM_SyncTextScan
      set !locindex !locindex + 1
      if !locindex > !locindexend
      {
        namespace pop
        return #TRUE
      }
      goto TravelFromObject_loop1
    }

    if ( ( #CHARPOSX = !oldx && #CHARPOSY = !oldy ) && #SCNT < !tempscnt )
      goto WaitforTravel2_loop1
  namespace pop
return #FALSE
;----------------------------------------------------------------------------------------------------------
; Brings !_jindex up to the most recent #journal entry
sub TM_SyncTextScan
  namespace push
  namespace local text
  set !_jindex #jindex + 1
  namespace pop
return
;---------------------------------------------------------------------------------------------------------
; %1, %2, %3, etc strings to match
; returns #TRUE for match, #FALSE for no match
;  Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
;  Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
sub TM_FindValidTextNoAdvance
  namespace push
  namespace local text
  set !temp_lpc #LPC
  set #LPC 1000
  set !num_args %0
  set !first_arg 1
  if !_jindex = N/A
    set !_jindex #jindex
  set !index !first_arg
  repeat
    set !temp_jindex !_jindex
    set !text % . !index
    while !temp_jindex <= #jindex
    {
      scanjournal !temp_jindex
      str pos #JOURNAL %charname 1
      set !namepos #STRRES
      str count #JOURNAL %charname
      set !namecnt #STRRES
      str pos #JOURNAL :_ 1
      set !smcpos #STRRES
      str pos #JOURNAL !text 1
      set !textpos #STRRES
      if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL
        set !pass #TRUE
      else
        set !pass #FALSE
      if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) )
      {
        set !temp_jindex !temp_jindex + 1
        set #LPC !temp_lpc
        namespace pop
        return #TRUE
      }
      set !temp_jindex !temp_jindex + 1
    }
    set !index !index + 1
  until !index - !first_arg >= !num_args
  set #LPC !temp_lpc
  namespace pop
return #FALSE
;-------------------------------------------------------------------------------------------------------
; %1 - string to mung
sub TM_AddUnderscore
  namespace push
  namespace local AU
  set !tempstring %1
  AddUnderscore_loop1:
    str pos !tempstring #SPC
    if #STRRES <> 0
    {
      set !val #STRRES - 1
      str left !tempstring !val
      set !left #STRRES
      set !val !val + 1
      str del !tempstring 1 !val
      set !tempstring !left , _ , #STRRES
      goto AddUnderscore_loop1
    }
  set #RESULT !tempstring
  namespace pop
return #RESULT
;---------------------------------------------------------------------------------------------
; %1 = Gumpname 1
; %2 = Gumpname 2
; #TRUE gump occured before timeout
sub GumpWait
  namespace push
  namespace local GW
  wait 10
  set !timedelay #SCNT
  while #SCNT <= !timedelay + 7
  {
    if #CONTNAME = %1 || #CONTNAME = %2
    {
      namespace pop
      return #TRUE
    }
  }
  namespace pop
return #FALSE

;===========================================================================================

;===============enter anthole1 sub==========================================================
Sub ENs_EnterAntHole1
   set !oldCharposx #CharPosX
   set !OldCharPosy #CharPosY
   set !EnterHoleTries 5
   If %Antholetypes = N/A
      set %AntHoleTypes PUI_SUI_RVB
   Finditem %AntHoleTypes G_3
   If #Findcnt >= 1
     {
     set #lObjectID #findid
     Repeat
       set !EnterHoleTries !EnterHoleTries - 1
       event Macro 17 0
       Wait 4
     Until #charposx <> !Oldcharposx || #Charposy <> !oldCharposy || !EnterHoleTries <= 0
     }
Return ( #charposx <> !Oldcharposx || #Charposy <> !oldCharposy  )

;==========================================================================================



;------find anthole 2 sub----------------------------------------------------------------------
sub ENs_FindHole2
  If %Hole2LoopValueMax = N/A
    gosub SetupHole2LoopValues
  set !holefound #False
  set !Loopvalue 0
  repeat
    gosub hole2move !loopvalue
    if !loopvalue > 10
    {
    gosub findhole2
    }
  until #result   ; hole found


; finish the loop.
;  repeat
;    gosub hole2move !loopvalue
;  Until !loopvalue >= %Hole2LoopValueMAx

wait 15
Return
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
Sub Hole2Move
    set !x %Hole2LoopValuex . %1
    set !y %Hole2LoopValuey . %1
    set !z %Hole2LoopValuez . %1
    set !Exit 20
    Repeat
      set !Exit !exit - 1
      event pathfind !x !y !z
      wait 1
    Until ( #Charposx = !x && #charposy = !y ) || !exit < 1
    set !loopvalue !loopValue + 1
    If !loopvalue >= %Hole2LoopValueMAx
      set !LoopValue 1
Return
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------

sub SetupHole2LoopValues

  gosub AddHole2loopvalue 5920 1800 1
  gosub AddHole2loopvalue 5921 1821 1
  gosub AddHole2loopvalue 5917 1843 5
  gosub AddHole2loopvalue 5917 1851 4
  gosub AddHole2loopvalue 5917 1851 4
  gosub AddHole2loopvalue 5907 1876 0
  gosub AddHole2loopvalue 5901 1882 3
  gosub AddHole2loopvalue 5900 1880 0
  
return
;-------------------------------------------------------------------------------------------
;-------------------------------------------------------------------------------------------

sub AddHole2LoopValue
  if %Hole2LoopValueMAx = N/A
     set %Hole2LoopValueMax 0
  set %Hole2LoopValueMax %Hole2LoopValueMax + 1
  set %Hole2LoopValuex . %Hole2LoopValueMax   %1
  set %Hole2LoopValuey . %Hole2LoopValueMax   %2
  set %Hole2LoopValuez . %Hole2LoopValueMax   %3
Return
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
sub FindHole2
  set #result #false
  finditem PUI_SUI_RVB G_5
  If #Findcnt > 0
    {
    set !exit 15
    Repeat
      finditem PUI_SUI_RVB G_5
      Event Pathfind #findx #findy #findz  ; the hole
      wait 1
      set !exit !exit -1
      finditem PUI_SUI_RVB G_2
    Until !exit < 1 || #findcnt > 0
    set #result #findcnt > 0
    }
Return #Result
;--------------------------------------------------------------------------------------------





;=======find queen sub=======================================================================

gosub ENs_findAntQueen
halt

sub ENs_FindAntQueen
  If %QueenLoopValueMax = N/A
    gosub SetupQueenLoopValues
  set !queenfound #False
  set !Loopvalue 0
  repeat
    gosub queenmove !loopvalue
    gosub findqueen
  until #result   ; queen found
  wait 5
Return

sub FindQueen
  set #result #false
  finditem OHB G_7
  If #Findcnt > 0
    {
    set !exit 15
    Repeat
      finditem OHB G_7
      Event Pathfind #findx #findy #findz  ; the queen
      wait 1
      set !exit !exit -1
      finditem OHB G_2
    Until !exit < 1 || #findcnt > 0
    set #result #findcnt > 0
    }
Return #Result

Sub QueenMove
    set !x %QueenLoopValuex . %1
    set !y %QueenLoopValuey . %1
    set !z %QueenLoopValuez . %1
    set !Exit 20
    Repeat
      set !Exit !exit - 1
      event pathfind !x !y !z
      wait 1
    Until ( #Charposx = !x && #charposy = !y ) || !exit < 1
    set !loopvalue !loopValue + 1
    If !loopvalue >= %QueenLoopValueMAx
      set !LoopValue 1
REturn

sub SetupQueenLoopValues
  gosub AddQueenloopvalue 5805 1908 3
  gosub AddQueenloopvalue 5803 1896 2
  gosub AddQueenloopvalue 5796 1889 2
  gosub AddQueenloopvalue 5788 1881 2
  gosub AddQueenloopvalue 5779 1872 0
  gosub AddQueenloopvalue 5770 1872 1
  gosub AddQueenloopvalue 5761 1876 0
  gosub AddQueenloopvalue 5755 1885 0
  gosub AddQueenloopvalue 5752 1895 2
  gosub AddQueenloopvalue 5756 1905 2
  gosub AddQueenloopvalue 5759 1910 5
  gosub AddQueenloopvalue 5769 1919 1
  gosub AddQueenloopvalue 5776 1924 3
  gosub AddQueenloopvalue 5780 1931 1
  gosub AddQueenloopvalue 5788 1933 4
  gosub AddQueenloopvalue 5796 1925 2
  gosub AddQueenloopvalue 5805 1915 3
  gosub AddQueenloopvalue 5810 1918 1
  gosub AddQueenloopvalue 5806 1925 3
  gosub AddQueenloopvalue 5799 1930 2
  gosub AddQueenloopvalue 5794 1926 4
  gosub AddQueenloopvalue 5797 1918 3
  gosub AddQueenloopvalue 5790 1913 3
  gosub AddQueenloopvalue 5781 1907 2
  gosub AddQueenloopvalue 5772 1904 1
  gosub AddQueenloopvalue 5764 1897 3
  gosub AddQueenloopvalue 5769 1889 1
  gosub AddQueenloopvalue 5775 1887 4
  gosub AddQueenloopvalue 5782 1894 1
  gosub AddQueenloopvalue 5777 1899 20
  gosub AddQueenloopvalue 5784 1900 0
  gosub AddQueenloopvalue 5789 1906 0
  gosub AddQueenloopvalue 5795 1912 4
  gosub AddQueenloopvalue 5801 1918 2
  gosub AddQueenloopvalue 5803 1916 5
  gosub AddQueenloopvalue 5807 1911 3
Return

sub AddQueenLoopValue
  if %QueenLoopValueMAx = N/A
     set %QueenLoopValueMax 0
  set %QueenLoopValueMAx %QueenLoopValueMax + 1
  set %QueenLoopValuex . %QueenLoopValueMax   %1
  set %QueenLoopValuey . %QueenLoopValueMax   %2
  set %QueenLoopValuez . %QueenLoopValueMax   %3
Return

;=========end sub ============================================


;======= Menu Sub ============================================
sub menu
menu Clear
menu Window Title Blacklisted's BoS Farmer
menu Window Color BtnFace
menu Window Size 300 225
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu Font Transparent #false
menu Font Align Left
menu Text EUOLabel1 12 44  Secure Bag ID:
menu Text EUOLabel2 12 72  Reward Bag ID:
menu Text EUOLabel3 12 100 Travel Method:
  menu Button setsecure_button 170 44 43 25 Set
menu Button setrewardbag_button 170 72 43 25 Set
menu Combo Create travelmethodbox 100 100 115
menu Combo Add travelmethodbox Recall
menu Combo Add travelmethodbox Sacred Journey
menu combo select travelmethodbox 1
menu Button start_button 170 128 43 25 Start
menu Font BGColor Window
menu Edit EUOEdit1 100 44 57 %secure
menu Font BGColor BtnFace
menu Font BGColor Window
menu Edit EUOEdit2 100 72 57 %rewardbag
menu Font BGColor BtnFace
  menu Show 421 270
  set #menubutton N/A

return
;======= End Sub =============================================






13
Combat/Healing/Looting / Blacklisteds Move Loot
« on: August 11, 2011, 04:15:45 PM »
Code: [Select]
;=================================================================
; Script Name: MoveItem
; Author: Cerveza
; Version: 1.0
; Shard OSI
; Revision Date: 12/8/2011
; Purpose: To move items from lootpack into seperate containers it will move all types or gem, reagent, imbuing ingreadients, from the lootbag to containers
; Globals: None
;=================================================================
;  1. open Move Item in easyuo
;  2. stand next to the containters you want to sort your loot into.
;  3. hit play.
;  4.  set your loot, gems, reagent, ingredients and misc item bags from the menu.
;  5. click the button for the items you want to moce or move them all
;
;  the user can specify any item they want by adding the item type to the %misc variable inside the script

;
;
; Thanks: {frneo and Cerveza for helping me right the script}
;=================================================================

14
General UO Chat / Subscription lapsed account
« on: August 10, 2011, 07:43:12 AM »
Hey guys I saw a post on one of the Atlantic forums about how a player was able to login whit an accont he had suspended, so i tryed the same thing with an account that i switched the subscriton off a couple of years ago. an low and belhold i was able to login and play.

I guess its to with the account migration at the moment im going to keep mining on it after all its free.

15
Script Debug / Help with script, am I heading int he right direction
« on: August 10, 2011, 07:33:18 AM »
Hi
Could i ask some advice on a script I'm trying to write.

While gathering loot to train imbueing I was getting fed up of dragging the gems and regs out of my pack by hand.
so I wanted to make a script that would pull the gems and regs out and seperate them into different containers, I can get the differant chests to open but im confused when it comes to moving the loot and and how to make the script first check for gems, move the gems then once there are no gems left move onto checking for regs and moving those. once I get that working I can work on adding user defined items. I have looked over some of the scripts already posted for ideas on how to solve it but I'd rather work it out rather than just plagiarise another scripters work.


Code: [Select]
;=================================================================
; Script Name: Blacklisted's MoveLoot
; Author: Blacklisted
; Version: 1.0
; Shard OSI
; Revision Date: 10/8/2011
; Purpose: To move loot into seperate containers
; Globals: None
;=================================================================

SET %Gems HVF_UVF_FVF_EVF_OVF_VUF_GVF_RVF_BVF_VVF_NVF_ZVF_
SET %Reagents KUF_JUF_KZF_JZF_MZF_WZF_RZF_SZF_DUF_TZF_UZF_YZF_IUF_

mainloop:

  gosub SelectLootBag:
  gosub SelectGemBag:
  gosub SelectRegBag:
  gosub OpenLootBag:
  gosub OpenGemBag:
  gosub OpenRegBag:
  gosub GetGems:
  gosub GetRegs:
  gosub MoveGems:
  gosub MoveRegs:
 
return


sub SelectLootBag:
display Please Select Your Loot Bag$
 set #targcurs 1
  target
  targetloop:
  if #targcurs = 1
    {
    goto targetloop:
    }
  set %LootBag #ltargetid
  wait 5
return

sub SelectGemBag:
display Please Select Your Gem Bag$
 set #targcurs 1
  target
  targetloop1:
  if #targcurs = 1
    {
    goto targetloop1:
    }
  set %GemBag #ltargetid
  wait 5
return

sub SelectRegBag:
display Please Select Your Reg Bag$
 set #targcurs 1
  target
  targetloop3:
  if #targcurs = 1
    {
    goto targetloop3:
    }
  set %RegBag #ltargetid
  wait 5
return

sub OpenLootBag:
  set #nextcposx 100
  set #nextcposy 600
  set #lobjectid %LootBag
  event macro 17
  wait 20
return

sub OpenGemBag:
  set #nextcposx 300
  set #nextcposy 600
  set #lobjectid %GemBag
  event macro 17
  wait 20
return

sub OpenRegBag:
  set #nextcposx 500
  set #nextcposy 600
  set #lobjectid %RegBag
  event macro 17
  wait 20
return

sub GetGems:
findItem %Gems C_ , %GemBag
repeat
 gosub MoveGems
until  #findKind = -1
set #lobjectID #findID
set #ltargetKind 1

Pages: [1] 2