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 - delchi

Pages: [1]
1
Script Debug / Re: Escort Script Problems
« on: April 12, 2014, 04:36:03 PM »
Worked wonderfully, thank you! Now I know what #Findindex does too !!

2
Script Debug / Escort Script Problems (FIXED)
« on: April 08, 2014, 09:16:24 AM »
This should be a simple script but I am having issues with it. Basically it fails to find some of the NPCs that I am looking for via the event property #FINDID.

Another problem that I had, which I fixed with a workaround... After the sub to gate, the script would jump back up to sub search and sub search would not return to where it was called, instead it returned to sub main. To fix this I added goto sub search at the end of sub gate.

Thank you for any and all help!

(The runebook methodology is not my script and I gave the original author credit)

The part of the script that I think is broken:
Code: [Select]
sub search
rescan:
     onhotkey f2
          gosub destination
     FINDITEM %npc G_10
      IF #FINDCNT > 0
     {
          EVENT PROPERTY #FINDID
          IF Messenger in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Messenger
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          EVENT PROPERTY #FINDID
          IF Mage in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Mage
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          IF Peasant in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Peasant
               }
               wait 10
               ignoreitem #FINDID
               return
          }

          IF Merchant in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Merchant
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          IF Noble in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Noble
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          IF Healer in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Healer
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          IF peasant in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 peasant
               }
               wait 10
               ignoreitem #FINDID
               return
          }

          
          IGNOREITEM #FINDID
     }
goto rescan
return


THE ENTIRE SCRIPT

Code: [Select]
; Escorting 2.0
;brit
set %b 1
;cove
set %c 2
;jhelom
set %j 3
;minoc
set %m 4
;glow
set %g 5
;serp
set %sh 6
;skara
set %s 7
;trin
set %t 8
;vesp
set %v 9
;yew
set %y 10
;ocllo
set %o 11
;nujelm
set %n 12
;bucs
set %buc 13
;magin
set %mag 14
;dungeon
set %d 15
SET %jewels HVF_UVF_FVF_EVF_OVF_VUF_GVF_RVF_BVF_VVF_NVF_ZVF_
set %loot_table HPF_RGH_CHH_RNH_IZF_ATG_NSG_NFF_KUF_JUF_RZF_JZF_MZF_WZF_KZF_SZF_HPE_FPE_CPE_IPE_POF_
set %loot_table %loot_table , %jewels
SET %npc HS_IS
set #lpc 10000
ignoreitem #CHARID
EVENT SYSMESSAGE Runebook
SET #TARGCURS 1
WHILE #TARGCURS = 1
      WAIT 5
Set %book #ltargetid

gosub main

sub main
loop:
onhotkey f1
gosub search
onhotkey f2
gosub destination
onhotkey f3
{
msg $
event macro 4 4 bank
}
onhotkey f4
gosub tele
onhotkey f5
gosub loot
goto loop
return

sub tele
set #targcurs 1
while #targcurs = 1
wait 20
set %box #ltargetid
event macro 15 22
target
set #ltargetkind 1
event macro 22 0
wait 1s
event macro 15 20
target
set #ltargetkind 1
event macro 22 0
return

sub loot
finditem %box G_1
set #lobjectid %box
event macro 17 0
wait 1s
finditem %loot_table C_ , %box
for %i 0 #FINDCNT
{
finditem %loot_table C_ , #ltargetid
    exevent drag #FINDid #findstack
wait 25
Exevent Dropc #backpackid
wait 25
}
return



sub search
rescan:
     onhotkey f2
          gosub destination
     FINDITEM %npc G_10
      IF #FINDCNT > 0
     {
          EVENT PROPERTY #FINDID
          IF Messenger in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Messenger
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          EVENT PROPERTY #FINDID
          IF Mage in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Mage
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          IF Peasant in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Peasant
               }
               wait 10
               ignoreitem #FINDID
               return
          }

          IF Merchant in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Merchant
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          IF Noble in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Noble
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          IF Healer in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 Healer
               }
               wait 10
               ignoreitem #FINDID
               return
          }
          IF peasant in #property
          {
               for %i 1 10
               {
               EVENT EXMSG #FINDID 3 33 peasant
               }
               wait 10
               ignoreitem #FINDID
               return
          }

          
          IGNOREITEM #FINDID
     }
goto rescan
return

sub destination
msg $
msg I will take thee$
msg Destination$
wait 2s
Scanjournal 1
  if trinsic in #journal
  gosub runebookdo gate %t %book
  if jhelom in #journal
  gosub runebookdo gate %j %book
  if magincia in #journal
  gosub runebookdo gate %mag %book
  if vesper in #journal
  gosub runebookdo gate %v %book
  if moonglow in #journal
  gosub runebookdo gate %g %book
  if yew in #journal
  gosub runebookdo gate %y %book
  if hold in #journal
  gosub runebookdo gate %sh %book
  if ocllo in #journal
  gosub runebookdo gate %o %book
  if skara in #journal
  gosub runebookdo gate %s %book
  if britain in #journal
  gosub runebookdo gate %b %book
  if Nujel'm in #journal
  gosub runebookdo gate %n %book
  if Minoc in #journal
  gosub runebookdo gate %m %book
  if den in #journal
  gosub runebookdo gate %buc %book
  if cove in #journal
  gosub runebookdo gate %c %book
  if dungeon in #journal
  gosub runebookdo gate %d %book
  gosub search
return
  
    
    
    
    
;==================================
; Script Name: RuneBookDo
; Author: Vito
; Version: 1.0a
; Client Tested with: 6.0.13 (91)
; EUO version tested with: 1.5 (148)
; Shard OSI / FS: FS ( RunUO ) Should work on OSI
; Revision Date: 13/04/2009
; Public Release: 13/04/2009
; Purpose: Handles most runebook functions
;==================================
;|
;| Parameters:
;|            %1 - "Do" ( setdefault  - Set default rune
;|                        drop        - Drop rune
;|                        charge      - Use charge on rune
;|                        recall      - Recall to rune
;|                        gate        - Open a gate to rune
;|                        sacred      - Sacred J. to rune )
;|            %2 - "Rune" ( Rune number, 1 to 16 )
;|            %3 - "Book" ( Runebook ID )
;|            [%4] - "TimeOut" ( Optional, sets timeout for
;|                               event based actions, in seconds )
;|
;| Return: #True if ok, else #False
;+-----------------------------------------------------------

sub RuneBookDo
    set %RBD_Do %1
    set %RBD_Rune %2 - 1
    set %RBD_Book %3

    ; Some security checks
    if %0 = 4
      set %RBD_TimeOut %4
    else
      set %RBD_TimeOut 10
    set %RBD_End #SCnt + %RBD_TimeOut

    if %0 < 3
      return #False

    if %RBD_Rune < 0 || %RBD_Rune > 15
      return #False

    ; Open the book

    finditem %RBD_Book C_ , #BackPackID
    set #LObjectID #FindID
    event macro 17
    while #ContKind <> SHT && %RBD_End > #SCnt
      wait 1

    if %RBD_Do = charge
    {
      set %RBD_X #ContPosX + 135
      if %RBD_Rune > 7
        set %RBD_X #ContPosX + 295
      ; Rather complex, uh?
      set %RBD_Y #ContPosY + 70 + ( 15 * ( %RBD_Rune % 8 ) )
    }
    else
    {
      ; Open the right page
      set %RBD_Page ( %RBD_Rune / 2 ) + 1
      if %RBD_Page < 5
        set %RBD_Page %RBD_Page - 1
      set %RBD_X #ContPosX + 140 + ( 35 * %RBD_Page )
      set %RBD_Y #ContPosY + 200
      click %RBD_X %RBD_Y dmc
      ; Unable to do event-based without using #PixCol (Puah!)
      wait 10

      if %RBD_Do = setdefault
      {
        set %RBD_X #ContPosX + 165 + ( 140 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 25
      }
      if %RBD_Do = drop
      {
        set %RBD_X #ContPosX + 140 + ( 160 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 120
      }
      if %RBD_Do = recall
      {
        set %RBD_X #ContPosX + 140 + ( 160 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 145
      }
      if %RBD_Do = gate
{
set %RBD_X #ContPosX + 210 + ( 160 * ( %RBD_Rune % 2 ) )
set %RBD_Y #ContPosY + 145
      }
      if %RBD_Do = sacred
      {
        set %RBD_X #ContPosX + 140 + ( 160 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 181
      }
    }
    click %RBD_X %RBD_Y dmc
return ;#True


3
New member introductions / Re: hi - edited
« on: December 17, 2010, 06:43:07 PM »
Probably a good idea to give myself a bump.  ;)

4
New member introductions / hi - edited
« on: November 28, 2010, 08:13:11 PM »
I am a UO vet with a few years of scripting experience. Looking to see what this forum has to offer and to see what I can do for you fellas. I have written scripts for gold farming, taming, reagent gathering (server specific), and mining. Currently I am working to improve on my gold farming script.

and the edit...

I am 24 years old and live in the US. I played on Lake Superior from 1998 to 2002. I started out as most did in those days as a miner and eventually grew into a PK miner until I became fully integrated into the PK lifestyle. Alot of good memories from those days. I eventually moved onto PRS around 2004. The first being Metropolis where I got my first real introduction into easyuo with the famous the walking mumbling miner bot (TWMMB). I never spent time learning the easyuo language but rather using other people's scripts. Around 2006 I moved onto Angel Island where I began learning to write my own scripts but I stopped playing UO do to real life circumstances, being deployed in the US army to Iraq. Upon my return to the states I started to play a role playing server called Grimmworld. That had to be one of the most interesting parts of my UO career. A few years later I was deployed to Afghanistan. Where I got back I played as a beta tester for a server called UO Saviour and currently am playing a different server, UOSA. I have begun to script lots of useful scripts for myself but I find that when I run into a problem there is no one there to guide me so I am left with all the troubleshooting. Most of the errors I end up with errors that are so minor that another pair of eyes probably could of picked it up right away. Sorry about not fixing this sooner alot of real life complications got in the way, mostly work. I was actually a member here before and guess my account got deleted due to inactivity. What I am looking most to achieve from this site is insight on my own scripts and to get ideas from members scripts.


Pages: [1]