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

Pages: 1 ... 6 7 [8]
106
Script Debug / Re: Search, Ignore, Reset, Search again
« on: July 13, 2008, 06:11:23 AM »
Ah ty for the info.

I ended up going with this after your suggestion (didn't quite work with that last else command)
Code: [Select]
menu get iron
if #menures = #true
   {
   for #findindex 1 #findcnt
       {
       if #findcol = %iron_color
          {
          set %ore #findid
          set %smelt smelt_iron
          return
          }
       else
          {
          if #findcol <> %iron_col
          ignoreitem #findid 1
          }
       }
   menu set iron #false
   ignoreitem reset 1
   gosub select_ore
   }

107
Script Debug / Search, Ignore, Reset, Search again
« on: July 13, 2008, 05:06:59 AM »
Well, I really wasn't sure what to title this post, but I'm working on a Ore Smelting script.  I'm able to get it working overall, but I am fine tuning some parts, and have hit a wall.

In my sub, where I identify the ore to be smelted, I am using a #findindex to search the bag, and I ignore all the ore that is not what I need (i.e. searching for iron).  Then do a search in the bag for #findcnt and if no ore is left in the bag, uncheck the checkbox, reset the ignoreitem and begin the next search.

Why do I ignore it? 
Well I'm using a Check Box in my menu that lets people select what type of ore they want to smelt at that time.  I know it seems silly, but even I have only wanted to smelt some Verite when I need some, and have a bag full of ore.

Now I have just figured out that #findindex is a great way to search through the bag, and I'm attempting to condense my scripts and simplify them without using #finditem over and over and over as I have done in the past.

Here is what I have written to accomplish my task.  However it always skips over the #findcnt section, so it never resets the ignoreitem, and does not uncheck the checkbox pertaining to that type of ore.

menu get iron pertains to the checkbox that is for Iron Ore.
%ore_type is the 4 types of ore that can be found (small broken, small, medium and large)
%resource_bag is obviously the bag full of ore
smelt_iron is the number of ore they are smelting at one time
%iron_color is 0, I have designated the color of each ore to identify them by, it works.

Code: [Select]
finditem %ore_type C_ , %resource_bag
menu get iron
if #menures = #true
   {
   for #findindex 1 #findcnt
       {
       if #findcol = %iron_color
          {
          set %ore #findid
          set %smelt smelt_iron
          }
       if #findcol <> %iron_col
          ignoreitem #findid 1
       if #findcnt < 1
          {
          menu set iron #false
          ignoreitem reset 1
          gosub select_ore
          }
       }
   return
   }

It repeats the #findindex  the number of times that I have ore in the pack, but once it goes through the last loop, it does not go through the if #findcnt < 1 section.

I know it may seem silly to you TM, but It looks correct to me.  Why isn't it working?

108
Script Debug / Advanced Journal Scan
« on: July 11, 2008, 01:23:38 PM »
Hey TM.

I have your Advanced Journal Scan placed in the Spring Cleaner script, and now since there are so many items, I want to be able to ignore a 'wrong' item that is in the bag.  If you drop an item on the NPC that he does not want he says "I'm not looking for one of those at the moment, sorry."

So here's a snippet I'm trying to put in using the Advanced Journal Scan Subs:
Code: [Select]
gosub TM_AdvJournalSync turnin 100
repeat
finditem * C_ , %bag
exevent drag #findid
 wait 10
exevent dropc %NPC
 wait 10
gosub TM_AdvJournalScan turnin VALID I'm_not_looking_for_one_of
if #RESULT = #TRUE
{
   ignoreitem #findid
   }
until #findcnt = 0

However, it is not ignoring the item, it just keeps attempting to drag the same item over and over.  Did I code this wrong?

Yes I have the Subs in the script.

109
Script Debug / Re: Alchemy Assistant
« on: July 11, 2008, 03:00:19 AM »
I did get the script working :D  yay!

Now Thank you TM for your advice and suggestions.  I didn't use what you posted, but I did learn from it.  I was being stubborn in the area of wanting to make what I wrote out of my head work.  I hope you understand?

I have not updated the pull_resources part to pull 10 from two stacks of 7 and 5 yet, as you previously suggested in the code above, but I will.  However, the script is working, and I have successfully made 15 different potions in a row all in one sitting.  I'm very happy with the results.

Thanks again TM.

110
Script Debug / Re: Alchemy Assistant
« on: July 10, 2008, 09:31:45 AM »
Ahh I didn't think about that.  Thanks for the update to the post TM.  When the servers get back up, I'll adjust the needed modifications and give it a test run.

I also found out that earlier in the script I designated the Resources Chest as %ResourceChest, yet later I was calling for %resource_bag so thats why I wasn't even getting a response, because it was not looking inside of any bag at all.

Thanks for the update brother, you as always are a true help!

111
Script Debug / Re: Alchemy Assistant
« on: July 08, 2008, 10:04:36 PM »
I've been doing some trouble shooting in this script.

Here again is the entire script:
Code: [Select]
set %alch_tool RQF
set %alch_tools_needed 5
set %tink_tool GTL_KTL_JTL
set %tink_tools_needed 2
set %bottle WUF
set %ingot_type ENK
set %board TLKset %size1 130
set %size2 100
set %pot_to_make 100
set %amount_to_make 200
set %resources AVF_WUF_UUF_ZUF_XWS_YWS_YUF_OUF_XUF_TUF_YZF_NUF_KZF_KUF_RZF_MZF_JUF_WZF_SZF_JZF_ENK_TZF_YZF
set %catposx 30
set %selposx 230
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXXXXXXXX MENU DESIGN XXXXXXXXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
menu window title Guadah's Alchemist Assistant
menu window color silver
menu window size 290 %size1
menu font bgcolor gray
menu shape potionbg 5 5 280 65 3 7 1 Black 7 Gray
menu font align right
menu text title 130 12 Resource Container:
menu text title 130 42 Potion Container:
menu font bgcolor silver
menu font align left
menu button target_resource_bag 230 10 30 24 Set
menu button target_dump_bag 230 40 30 24 Set
menu edit resource_bag 135 10 85 %resource_bag
menu edit dump_bag 135 40 85 %dump_bag
menu button start 170 75 55 25 Start
menu button quit 230 75 55 25 Quit
menu font size 9
menu font color marron
menu text titles 20 80 Select Type
menu text titles 115 80 Amount
menu button add_more 175 105 20 20 +
menu button remove 200 105 20 20 -
menu font size 8
menu font color black
menu combo create %pot_to_make 5 %size2 100
menu combo add %pot_to_make Total Refreshment
menu combo add %pot_to_make Greater Agility
menu combo add %pot_to_make Night Sight
menu combo add %pot_to_make Greater Heal
menu combo add %pot_to_make Greater Strength
menu combo add %pot_to_make Poison
menu combo add %pot_to_make Greater Poison
menu combo add %pot_to_make Deadly Poison
menu combo add %pot_to_make Greater Cure
menu combo add %pot_to_make Greater Explosion
menu combo add %pot_to_make Greater Conflagration
menu combo add %pot_to_make Greater Confusion Blast
menu combo add %pot_to_make Invisibility
menu combo add %pot_to_make Parasitic
menu combo add %pot_to_make Darkglow
menu edit %amount_to_make 110 %size2 50 0
menu show
gosub TM_GetPersistantVariable resource_bag
menu set resource_bag #result
menu get resource_bag
set %ResourceChest #menures
set #lobjectid %ResourceChest
event macro 17 0
 wait 10
contpos 610 440
 wait 10
gosub TM_GetPersistantVariable dump_bag
menu set dump_bag #result
menu get dump_bag
menuloop:
if #menuButton = target_resource_bag
   {
   set #targCurs 1
set_resource_bag:
    if #targCurs = 1
     goto set_resource_bag
   Set %resource_bag #ltargetid
   Set #lobjectid %resource_bag
   Event Macro 17 0
    wait 10
   contpos 610 440
    wait 10
   menu font size 10
   menu set resource_bag %resource_bag
   gosub TM_SetPersistantVariable resource_bag %resource_bag
   set #menubutton N/A
   }
if #menuButton = target_dump_bag
   {
   set #targCurs 1
set_dump_bag:
    if #targCurs = 1
     goto set_dump_bag
   Set %dump_bag #ltargetid
   menu font size 10
   menu set dump_bag %dump_bag
   gosub TM_SetPersistantVariable dump_bag %dump_bag
   set #menubutton N/A
   }
if #menubutton = add_more
   {
   gosub add_more
   set #menubutton N/A
   }
if #menubutton = remove
   {
   gosub remove
   set #menubutton N/A
   }
if #menubutton = Start
   {
   set #menubutton N/A
   set %size2 100
   set %pot_to_make 100
   set %amount_to_make 200
   gosub loop
   }
if #menubutton = Quit
   {
   set #menubutton N/A
   display ok Thank you for using my script.$
           +$
           +Script is Halting$
   menu hide
   halt
   }
goto menuloop
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXX SUB TO ADD ANOTHER OPTION XXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub add_more
set %size1 ( %size1 + 25 )
set %size2 ( %size2 + 25 )
set %pot_to_make ( %pot_to_make + 1 )
set %amount_to_make ( %amount_to_make + 1 )
menu window size 290 %size1
menu font size 8
menu font color black
menu combo create %pot_to_make 5 %size2 100
menu combo add %pot_to_make Total Refreshment
menu combo add %pot_to_make Greater Agility
menu combo add %pot_to_make Night Sight
menu combo add %pot_to_make Greater Heal
menu combo add %pot_to_make Greater Strength
menu combo add %pot_to_make Poison
menu combo add %pot_to_make Greater Poison
menu combo add %pot_to_make Deadly Poison
menu combo add %pot_to_make Greater Cure
menu combo add %pot_to_make Greater Explosion
menu combo add %pot_to_make Greater Conflagration
menu combo add %pot_to_make Greater Confusion Blast
menu combo add %pot_to_make Invisibility
menu combo add %pot_to_make Parasitic
menu combo add %pot_to_make Darkglow
menu edit %amount_to_make 110 %size2 50 0
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXX SUB TO REMOVE AN OPTION XXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub remove
if %pot_to_make = 100
   return
set %size1 ( %size1 - 25 )
set %size2 ( %size2 - 25 )
menu window size 290 %size1
menu delete %pot_to_make
menu delete %amount_to_make
set %pot_to_make ( %pot_to_make - 1 )
set %amount_to_make ( %amount_to_make - 1 )
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXXXX MAIN LOOP FOR SCRIPT XXXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub loop
crafting_loop:
gosub clear_pack
gosub check_tool %alch_tool %alch_tools_needed %catposx 110 %selposx 90
gosub check_tool %tink_tool %tink_tools_needed %catposx 110 %selposx 130
gosub potion_init
gosub grab_resources %bottle %reagent1 %reagent2
gosub craft_potion %alch_tool %alch_tools_needed %catposx %catposy %selposx %selposy
goto crafting_loop
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX SUB TO FIND AND RETURN RESOURCES XXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub clear_pack
finditem %resources C_ , #backpackid
for %i 1 #findcnt
    {
    finditem %resources C_ , #backpackid
    exevent drag #findid #findstack
     wait 10
    exevent dropc %resource_bag
     wait 15
    }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXX SUB TO CHECK AND CRAFT TOOLS XXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub check_tool
finditem %1 C_ , #backpackid
if #findcnt >= %2
   return
set %to_make ( %2 - #findcnt ) ; Sets a number of tools to make
set #lobjectid #findid
; --------------------------------
; This section looks for ingots, then pulls 100
finditem %ingot_type C_ , %resource_bag
for #findindex 1 #findcnt
    {
    event property #findid
    if copper || shadow || bronze || agapite || gold || verite || valorite in #property
     ignoreitem #findid
    if ingots in #property && shadow notin #property
    set %ingots #findid    ; Finds only Iron Ingots
    }
finditem %ingots C_ , %resource_bag
if #findcnt < 20
   {
   display ok You are out of ingots.$
           +Please get more and resetart script.
   gosub clear_pack
   halt
   }
finditem %ingots C_ , %resource_bag
exevent drag #findid 100
 wait 10
exevent dropc #backpackid
 wait 15
; --------------------------------
; Makes tool required, and loops %to_make (number of tools needed) times
event macro 22 0
  gosub gumpwait
 set %x #contposx + %3
 set %y #contposy + %4
 click %x %y ; Selects Category
  gosub gumpwait
for %i 1 %to_make
 {
 set %x #contposx + %5
 set %y #contposy + %6
 click %x %y ; Selects Tool
  gosub gumpwait
 }
gosub clear_pack
finditem %1 C_ , #backpackid
if #findcnt < %2
   gosub check_tool
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX SETS ITEMS NEEDED FOR EACH POTION XXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub potion_init
menu get %pot_to_make
if #menuRes = 1 ; Total Refreshment
   {
   set %reagent1 KUF ; Black Pearl
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 90
   set %selposy 90
   menu getnum %amount_to_make
   set %amount #menures
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   }
if #menuRes = 2 ; Greater Agility
   {
   set %reagent1 JUF ; Bloodmoss
   set %reagent2 N/A ; N/A
   set %required_reagent1 3
   set %required_reagent2 N/A
   set %catposy 110
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 3 ; Night Sight
   {
   set %reagent1 RZF ; Spider's Silk
   set %reagent2 N/A ; N/A
   set %required_reagent1 1
   set %required_reagent2 N/A
   set %catposy 130
   set %selposy 70
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 4 ; Greater Heal
   {
   set %reagent1 JZF ; Ginseng
   set %reagent2 N/A ; N/A
   set %required_reagent1 7
   set %required_reagent2 N/A
   set %catposy 150
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 5 ; Greater Strength
   {
   set %reagent1 MZF ; Mandrake Root
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 170
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 6 ; Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 2
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 7 ; Greater Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 4
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 8 ; Deadly Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 8
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 130
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 9 ; Greater Cure
   {
   set %reagent1 KZF ; Garlic
   set %reagent2 N/A ; N/A
   set %required_reagent1 6
   set %required_reagent2 N/A
   set %catposy 210
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 10 ; Greater Explosion
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 230
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 11 ; Greater Conflagration
   {
   set %reagent1 TZF ; Grave Dust
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 250
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 12 ; Greater Confusion Blast
   {
   set %reagent1 YZF ; Pig Iron
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 250
   set %selposy 130
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 13 ; Invisibility
   {
   set %reagent1 JUF ; Bloodmoss
   set %reagent2 WZF ; Nightshade
   set %required_reagent1 4
   set %required_reagent2 3
   set %catposy 270
   set %selposy 70
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 14 ; Parasitic
   {
   set %reagent1 YWS ; Parasitic Plant
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 270
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 15 ; Darkglow
   {
   set %reagent1 XWS ; Luminescent Fungi
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 270
   set %selposy 110
   menu getnum %amount_to_make
   set %amount #menures
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXX SUB TO FIND AND GRAB RESOURCES XXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub grab_resources
if %amount >= 100
   {
   set %grab 100
   }
if %amount < 100
   {
   set %grab %amount
   }
; Finds and grabs Bottles
repeat
finditem %bottle C_ , %resource_bag
exevent drag #findid %grab
 wait 10
exevent dropc #backpackid
 wait 15
until #findcnt >= %grab
; Finds and grabs Reagent #1
repeat
finditem %1 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
until #findcnt >= 1000
; Finds and grabs Reagent #2
finditem %2 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
return

sub grab_more_resources
; Finds and grabs Reagent #1
finditem %1 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
; Finds and grabs Reagent #2
finditem %2 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXX SUB FOR MAKING THE POTIONS XXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub craft_potion
repeat
finditem %reagent1 C_ , #backpackid
if #findcnt < %required_reagent
   gosub grab_more_resources %reagent1
finditem %1 C_ , #backpackid
if #findcnt < %2
   gosub check_tool %alch_tool %alch_tools_needed %catposx 110 %selposx 90
event macro 22 0
  gosub gumpwait
 set %x #contposx + %3
 set %y #contposy + %4
 click %x %y ; Category
  gosub gumpwait
 set %x #contposx + %5
 set %y #contposy + %6
 click %x %y ; Selection (Potion)
  gosub gumpwait
finditem %bottle C_ , #backpackid
until #findcnt = 0
gosub clear_pack
set %amount ( %amount - %grab )
if %amount = 0
   {
   menu delete %amount_to_make
   menu font color red
   menu text done 120 %size2 Done!
   set %size2 ( %size2 + 25 )
   set %pot_to_make ( %pot_to_make + 1 )
   set %amount_to_make ( %amount_to_make + 1 )
   return
   }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX GUMP WAIT SUB, ENSURES GUMP IS UP XXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub gumpwait
set %timer #SCNT + 5
 repeat
  until #CONTNAME = generic_gump || #SCNT > %timer
if #contname <> generic_gump
   {
   event macro 17 0
   }
Return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXX TRAILMYX'S PERSISTANT VARIABLE SUBS XXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub TM_GetPersistantVariable
  set #RESULT %1 , _ , #CHARID
  set #RESULT * . #RESULT
return #RESULT
sub TM_SetPersistantVariable
  set #RESULT %1 , _ , #CHARID
  set * . #RESULT %2
return

Now in the Pull Resources Sub, I have ensured that it is detecting the amount to grab, AND that it knows its grabbing bottles.  I have verified this with something like this after the line of code that designates it.
Display ok You have %bottle

Well, I know its not perfect, but it works and it tells me that the %amount and that %bottles both have values.

Now with that said, it gets down to sub pull_resources and just loops between the return and until over and over, not pulling the bottles out of the %resource_bag

Maybe I don't have the resource bag designated?
Code: [Select]
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXX SUB TO FIND AND GRAB RESOURCES XXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub grab_resources
if %amount >= 100
   {
   set %grab 100
   }
if %amount < 100
   {
   set %grab %amount
   }
; Finds and grabs Bottles
repeat
finditem %bottle C_ , %resource_bag
exevent drag #findid %grab
 wait 10
exevent dropc #backpackid
 wait 15
until #findcnt >= %grab
; Finds and grabs Reagent #1
repeat
finditem %1 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
until #findcnt >= 1000
; Finds and grabs Reagent #2
finditem %2 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
return

sub grab_more_resources
; Finds and grabs Reagent #1
finditem %1 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
; Finds and grabs Reagent #2
finditem %2 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
return

112
Script Debug / Re: Issue with "for..." command
« on: July 08, 2008, 01:23:23 PM »
I have a bag full of ore, 4 types of each ore.  I want it to search through the bag, and label each piece, so I can pull it out by %iron_ore or %valo_ore later in the script.

113
Script Debug / Re: Alchemy Assistant
« on: July 08, 2008, 01:22:07 PM »
Yes, I think it must be an error in how I coded the variables.  When it goes from start, and cycles through the loop, everything looks fine when I line through it (F7).

However when it gets to the pull resources loop, it goes through each line, but does not 'pull' the resources out.  Only thing I can think of is that it does not set the items to pull correctly.

114
Script Debug / Re: Alchemy Assistant
« on: July 08, 2008, 07:44:49 AM »
Not bad for writing it off the top of my head in the wee hours of the morning.  I corrected those two warnings, here it is again.

I'd love it if anybody could take a gander at it, to see if its written correctly.
Code: [Select]
set %alch_tool RQF
set %alch_tools_needed 5
set %tink_tool GTL_KTL_JTL
set %tink_tools_needed 2
set %bottle WUF
set %ingot_type ENK
set %board TLK
set %size1 130
set %size2 100
set %pot_to_make 100
set %amount_to_make 200
set %resources AVF_WUF_UUF_ZUF_XWS_YWS_YUF_OUF_XUF_TUF_YZF_NUF_KZF_KUF_RZF_MZF_JUF_WZF_SZF_JZF_ENK_TZF_YZF
set %catposx 30
set %selposx 230
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXXXXXXXX MENU DESIGN XXXXXXXXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
menu window title menu test
menu window color silver
menu window size 290 %size1
menu font bgcolor gray
menu shape potionbg 5 5 280 65 3 7 1 Black 7 Gray
menu font align right
menu text title 130 12 Resource Container:
menu text title 130 42 Potion Container:
menu font bgcolor silver
menu font align left
menu button target_resource_bag 230 10 30 24 Set
menu button target_dump_bag 230 40 30 24 Set
menu edit resource_bag 135 10 85 %resource_bag
menu edit dump_bag 135 40 85 %dump_bag
menu button start 170 75 55 25 Start
menu button quit 230 75 55 25 Quit
menu font size 9
menu font color marron
menu text titles 20 80 Select Type
menu text titles 115 80 Amount
menu button add_more 175 105 20 20 +
menu button remove 200 105 20 20 -
menu font size 8
menu font color black
menu combo create %pot_to_make 5 %size2 100
menu combo add %pot_to_make Total Refreshment
menu combo add %pot_to_make Greater Agility
menu combo add %pot_to_make Night Sight
menu combo add %pot_to_make Greater Heal
menu combo add %pot_to_make Greater Strength
menu combo add %pot_to_make Poison
menu combo add %pot_to_make Greater Poison
menu combo add %pot_to_make Deadly Poison
menu combo add %pot_to_make Greater Cure
menu combo add %pot_to_make Greater Explosion
menu combo add %pot_to_make Greater Conflagration
menu combo add %pot_to_make Greater Confusion Blast
menu combo add %pot_to_make Invisibility
menu combo add %pot_to_make Parasitic
menu combo add %pot_to_make Darkglow
menu edit %amount_to_make 110 %size2 50 0
menu show
gosub TM_GetPersistantVariable resource_bag
menu set resource_bag #result
menu get resource_bag
set %ResourceChest #menures
set #lobjectid %ResourceChest
event macro 17 0
 wait 10
contpos 610 440
 wait 10
gosub TM_GetPersistantVariable dump_bag
menu set dump_bag #result
menu get dump_bag
menuloop:
if #menuButton = target_resource_bag
   {
   set #targCurs 1
set_resource_bag:
    if #targCurs = 1
     goto set_resource_bag
   Set %resource_bag #ltargetid
   Set #lobjectid %resource_bag
   Event Macro 17 0
    wait 10
   contpos 610 440
    wait 10
   menu font size 10
   menu set resource_bag %resource_bag
   gosub TM_SetPersistantVariable resource_bag %resource_bag
   set #menubutton N/A
   }
if #menuButton = target_dump_bag
   {
   set #targCurs 1
set_dump_bag:
    if #targCurs = 1
     goto set_dump_bag
   Set %dump_bag #ltargetid
   menu font size 10
   menu set dump_bag %dump_bag
   gosub TM_SetPersistantVariable dump_bag %dump_bag
   set #menubutton N/A
   }
if #menubutton = add_more
   {
   gosub add_more
   set #menubutton N/A
   }
if #menubutton = remove
   {
   gosub remove
   set #menubutton N/A
   }
if #menubutton = Start
   {
   set #menubutton N/A
   set %size2 100
   set %pot_to_make 100
   set %amount_to_make 200
   gosub loop
   }
if #menubutton = Quit
   {
   set #menubutton N/A
   display ok Thank you for using my script.$
           +$
           +Script is Halting$
   menu hide
   halt
   }
goto menuloop
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXX SUB TO ADD ANOTHER OPTION XXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub add_more
set %size1 ( %size1 + 25 )
set %size2 ( %size2 + 25 )
set %pot_to_make ( %pot_to_make + 1 )
set %amount_to_make ( %amount_to_make + 1 )
menu window size 290 %size1
menu font size 8
menu font color black
menu combo create %pot_to_make 5 %size2 100
menu combo add %pot_to_make Total Refreshment
menu combo add %pot_to_make Greater Agility
menu combo add %pot_to_make Night Sight
menu combo add %pot_to_make Greater Heal
menu combo add %pot_to_make Greater Strength
menu combo add %pot_to_make Poison
menu combo add %pot_to_make Greater Poison
menu combo add %pot_to_make Deadly Poison
menu combo add %pot_to_make Greater Cure
menu combo add %pot_to_make Greater Explosion
menu combo add %pot_to_make Greater Conflagration
menu combo add %pot_to_make Greater Confusion Blast
menu combo add %pot_to_make Invisibility
menu combo add %pot_to_make Parasitic
menu combo add %pot_to_make Darkglow
menu edit %amount_to_make 110 %size2 50 0
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXX SUB TO REMOVE AN OPTION XXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub remove
if %pot_to_make = 100
   return
set %size1 ( %size1 - 25 )
set %size2 ( %size2 - 25 )
menu window size 290 %size1
menu delete %pot_to_make
menu delete %amount_to_make
set %pot_to_make ( %pot_to_make - 1 )
set %amount_to_make ( %amount_to_make - 1 )
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXXXX MAIN LOOP FOR SCRIPT XXXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub loop
crafting_loop:
gosub clear_pack
gosub check_tool %alch_tool %alch_tools_needed %catposx 110 %selposx 90
gosub check_tool %tink_tool %tink_tools_needed %catposx 110 %selposx 130
gosub potion_init
gosub grab_resources %bottle %reagent1 %reagent2
gosub craft_potion %alch_tool %alch_tools_needed %catposx %catposy %selposx %selposy
goto crafting_loop
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX SUB TO FIND AND RETURN RESOURCES XXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub clear_pack
finditem %resources C_ , #backpackid
for %i 1 #findcnt
    {
    finditem %resources C_ , #backpackid
    exevent drag #findid #findstack
     wait 10
    exevent dropc %resource_bag
     wait 15
    }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXX SUB TO CHECK AND CRAFT TOOLS XXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub check_tool
finditem %1 C_ , #backpackid
if #findcnt >= %2
   return
set %to_make ( %2 - #findcnt ) ; Sets a number of tools to make
set #lobjectid #findid
; --------------------------------
; This section looks for ingots, then pulls 100
finditem %ingot_type C_ , %resource_bag
for #findindex 1 #findcnt
    {
    event property #findid
    if copper || shadow || bronze || agapite || gold || verite || valorite in #property
     ignoreitem #findid
    if ingots in #property && shadow notin #property
    set %ingots #findid    ; Finds only Iron Ingots
    }
finditem %ingots C_ , %resource_bag
if #findcnt < 20
   {
   display ok You are out of ingots.$
           +Please get more and resetart script.
   gosub clear_pack
   halt
   }
finditem %ingots C_ , %resource_bag
exevent drag #findid 100
 wait 10
exevent dropc #backpackid
 wait 15
; --------------------------------
; Makes tool required, and loops %to_make (number of tools needed) times
event macro 22 0
  gosub gumpwait
 set %x #contposx + %3
 set %y #contposy + %4
 click %x %y ; Selects Category
  gosub gumpwait
for %i 1 %to_make
 {
 set %x #contposx + %5
 set %y #contposy + %6
 click %x %y ; Selects Tool
  gosub gumpwait
 }
gosub clear_pack
finditem %1 C_ , #backpackid
if #findcnt < %2
   gosub check_tool
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX SETS ITEMS NEEDED FOR EACH POTION XXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub potion_init
menu get %pot_to_make
if #menuRes = 1 ; Total Refreshment
   {
   set %reagent1 KUF ; Black Pearl
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 90
   set %selposy 90
   menu getnum %amount_to_make
   set %amount #menures
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   }
if #menuRes = 2 ; Greater Agility
   {
   set %reagent1 JUF ; Bloodmoss
   set %reagent2 N/A ; N/A
   set %required_reagent1 3
   set %required_reagent2 N/A
   set %catposy 110
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 3 ; Night Sight
   {
   set %reagent1 RZF ; Spider's Silk
   set %reagent2 N/A ; N/A
   set %required_reagent1 1
   set %required_reagent2 N/A
   set %catposy 130
   set %selposy 70
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 4 ; Greater Heal
   {
   set %reagent1 JZF ; Ginseng
   set %reagent2 N/A ; N/A
   set %required_reagent1 7
   set %required_reagent2 N/A
   set %catposy 150
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 5 ; Greater Strength
   {
   set %reagent1 MZF ; Mandrake Root
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 170
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 6 ; Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 2
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 7 ; Greater Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 4
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 8 ; Deadly Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 8
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 130
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 9 ; Greater Cure
   {
   set %reagent1 KZF ; Garlic
   set %reagent2 N/A ; N/A
   set %required_reagent1 6
   set %required_reagent2 N/A
   set %catposy 210
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 10 ; Greater Explosion
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 230
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 11 ; Greater Conflagration
   {
   set %reagent1 TZF ; Grave Dust
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 250
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 12 ; Greater Confusion Blast
   {
   set %reagent1 YZF ; Pig Iron
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 250
   set %selposy 130
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 13 ; Invisibility
   {
   set %reagent1 JUF ; Bloodmoss
   set %reagent2 WZF ; Nightshade
   set %required_reagent1 4
   set %required_reagent2 3
   set %catposy 270
   set %selposy 70
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 14 ; Parasitic
   {
   set %reagent1 YWS ; Parasitic Plant
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 270
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 15 ; Darkglow
   {
   set %reagent1 XWS ; Luminescent Fungi
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 270
   set %selposy 110
   menu getnum %amount_to_make
   set %amount #menures
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXX SUB TO FIND AND GRAB RESOURCES XXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub grab_resources
if %amount >= 100
   set %grab 100
if %amount < 100
   set %grab %amount
; Finds and grabs Bottles
finditem %bottle C_ , %resource_bag
exevent drag #findid %grab
 wait 10
exevent dropc #backpackid
 wait 15
; Finds and grabs Reagent #1
finditem %1 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
; Finds and grabs Reagent #2
finditem %2 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
return

sub grab_more_resources
; Finds and grabs Reagent #1
finditem %1 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
; Finds and grabs Reagent #2
finditem %2 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXX SUB FOR MAKING THE POTIONS XXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub craft_potion
repeat
finditem %reagent1 C_ , #backpackid
if #findcnt < %required_reagent
   gosub grab_more_resources %reagent1
finditem %1 C_ , #backpackid
if #findcnt < %2
   gosub check_tool %alch_tool %alch_tools_needed %catposx 110 %selposx 90
event macro 22 0
  gosub gumpwait
 set %x #contposx + %3
 set %y #contposy + %4
 click %x %y ; Category
  gosub gumpwait
 set %x #contposx + %5
 set %y #contposy + %6
 click %x %y ; Selection (Potion)
  gosub gumpwait
finditem %bottle C_ , #backpackid
until #findcnt = 0
gosub clear_pack
set %amount ( %amount - %grab )
if %amount = 0
   {
   menu delete %amount_to_make
   menu font color red
   menu text done 120 %size2 Done!
   set %size2 ( %size2 + 25 )
   set %pot_to_make ( %pot_to_make + 1 )
   set %amount_to_make ( %amount_to_make + 1 )
   return
   }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX GUMP WAIT SUB, ENSURES GUMP IS UP XXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub gumpwait
set %timer #SCNT + 5
 repeat
  until #CONTNAME = generic_gump || #SCNT > %timer
if #contname <> generic_gump
   {
   event macro 17 0
   }
Return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXX TRAILMYX'S PERSISTANT VARIABLE SUBS XXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub TM_GetPersistantVariable
  set #RESULT %1 , _ , #CHARID
  set #RESULT * . #RESULT
return #RESULT
sub TM_SetPersistantVariable
  set #RESULT %1 , _ , #CHARID
  set * . #RESULT %2
return

115
Script Debug / Alchemy Assistant
« on: July 08, 2008, 04:10:29 AM »
Aloha!

Last night I woke up, and believe it or not, I was actually dreaming about scripting.  So as I attempted to go back to sleep, I had this code running through my head, and really wanted to get it down.  So I came downstairs at 3:45 am, and wrote out an Alchemy Assistant.  A Potion Crafter I suppose you can call it.

The menu I am quite proud of, its better then any I've done in the past, and am using your (TM) Persistant Variable Subs in it as well.  I attempted to test this out this morning (4 hours of writing), but it does not pull any reagents out of the resource chest.

I went over it a few times, but do not see the error, and I was wondering if you, or anybody could give it a eye-over, and if you could run that nice little Syntax Error finder thing, to bring up the error's in code that I tend to have.

I must say, this is the best script I've written to date, and I'm pretty happy with how the flow works.  Give me some harsh feedback please, its the way I learn best.

Code: [Select]
set %alch_tool RQF
set %alch_tools_needed 5
set %tink_tool GTL_KTL_JTL
set %tink_tools_needed 2
set %bottle WUF
set %ingot_type ENK
set %board TLK
set %size1 130
set %size2 100
set %pot_to_make 100
set %amount_to_make 200
set %resources AVF_WUF_UUF_ZUF_XWS_YWS_YUF_OUF_XUF_TUF_YZF_NUF_KZF_KUF_RZF_MZF_JUF_WZF_SZF_JZF_ENK_TZF_YZF
set %catposx 30
set %selposx 230
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXXXXXXXX MENU DESIGN XXXXXXXXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
menu window title menu test
menu window color silver
menu window size 290 %size1
menu font bgcolor gray
menu shape potionbg 5 5 280 65 3 7 1 Black 7 Gray
menu font align right
menu text title 130 12 Resource Container:
menu text title 130 42 Potion Container:
menu font bgcolor silver
menu font align left
menu button target_resource_bag 230 10 30 24 Set
menu button target_dump_bag 230 40 30 24 Set
menu edit resource_bag 135 10 85 %resource_bag
menu edit dump_bag 135 40 85 %dump_bag
menu button start 170 75 55 25 Start
menu button quit 230 75 55 25 Quit
menu font size 9
menu font color marron
menu text titles 20 80 Select Type
menu text titles 115 80 Amount
menu button add_more 175 105 20 20 +
menu button remove 200 105 20 20 -
menu font size 8
menu font color black
menu combo create %pot_to_make 5 %size2 100
menu combo add %pot_to_make Total Refreshment
menu combo add %pot_to_make Greater Agility
menu combo add %pot_to_make Night Sight
menu combo add %pot_to_make Greater Heal
menu combo add %pot_to_make Greater Strength
menu combo add %pot_to_make Poison
menu combo add %pot_to_make Greater Poison
menu combo add %pot_to_make Deadly Poison
menu combo add %pot_to_make Greater Cure
menu combo add %pot_to_make Greater Explosion
menu combo add %pot_to_make Greater Conflagration
menu combo add %pot_to_make Greater Confusion Blast
menu combo add %pot_to_make Invisibility
menu combo add %pot_to_make Parasitic
menu combo add %pot_to_make Darkglow
menu edit %amount_to_make 110 %size2 50 0
menu show
gosub TM_GetPersistantVariable resource_bag
menu set resource_bag #result
menu get resource_bag
set %ResourceChest #menures
set #lobjectid %ResourceChest
event macro 17 0
 wait 10
contpos 610 440
 wait 10
gosub TM_GetPersistantVariable dump_bag
menu set dump_bag #result
menu get dump_bag
menuloop:
if #menuButton = target_resource_bag
   {
   set #targCurs 1
set_resource_bag:
    if #targCurs = 1
     goto set_resource_bag
   Set %resource_bag #ltargetid
   Set #lobjectid %resource_bag
   Event Macro 17 0
    wait 10
   contpos 610 440
    wait 10
   menu font size 10
   menu set resource_bag %resource_bag
   gosub TM_SetPersistantVariable resource_bag %resource_bag
   set #menubutton N/A
   }
if #menuButton = target_dump_bag
   {
   set #targCurs 1
set_dump_bag:
    if #targCurs = 1
     goto set_dump_bag
   Set %dump_bag #ltargetid
   menu font size 10
   menu set dump_bag %dump_bag
   gosub TM_SetPersistantVariable dump_bag %dump_bag
   set #menubutton N/A
   }
if #menubutton = add_more
   {
   gosub add_more
   set #menubutton N/A
   }
if #menubutton = remove
   {
   gosub remove
   set #menubutton N/A
   }
if #menubutton = Start
   {
   set #menubutton N/A
   set %size2 30
   set %pot_to_make 100
   set %amount_to_make 200
   gosub loop
   }
if #menubutton = Quit
   {
   set #menubutton N/A
   display ok Thank you for using my script.$
           +$
           +Script is Halting$
   menu hide
   halt
   }
goto menuloop
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXX SUB TO ADD ANOTHER OPTION XXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub add_more
set %size1 ( %size1 + 25 )
set %size2 ( %size2 + 25 )
set %pot_to_make ( %pot_to_make + 1 )
set %amount_to_make ( %amount_to_make + 1 )
menu window size 290 %size1
menu font size 8
menu font color black
menu combo create %pot_to_make 5 %size2 100
menu combo add %pot_to_make Total Refreshment
menu combo add %pot_to_make Greater Agility
menu combo add %pot_to_make Night Sight
menu combo add %pot_to_make Greater Heal
menu combo add %pot_to_make Greater Strength
menu combo add %pot_to_make Poison
menu combo add %pot_to_make Greater Poison
menu combo add %pot_to_make Deadly Poison
menu combo add %pot_to_make Greater Cure
menu combo add %pot_to_make Greater Explosion
menu combo add %pot_to_make Greater Conflagration
menu combo add %pot_to_make Greater Confusion Blast
menu combo add %pot_to_make Invisibility
menu combo add %pot_to_make Parasitic
menu combo add %pot_to_make Darkglow
menu edit %amount_to_make 110 %size2 50 0
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXX SUB TO REMOVE AN OPTION XXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub remove
if %pot_to_make = 100
   return
set %size1 ( %size1 - 25 )
set %size2 ( %size2 - 25 )
menu window size 290 %size1
menu delete %pot_to_make
menu delete %amount_to_make
set %pot_to_make ( %pot_to_make - 1 )
set %amount_to_make ( %amount_to_make - 1 )
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXXXXX MAIN LOOP FOR SCRIPT XXXXXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub loop
crafting_loop:
gosub clear_pack
gosub check_tool %alch_tool %alch_tools_needed %catposx 110 %selposx 90
gosub check_tool %tink_tool %tink_tools_needed %catposx 110 %selposx 130
gosub potion_init
gosub grab_resources %bottle %reagent1 %reagent2
gosub craft_potion %alch_tool %alch_tools_needed %catposx %catposy %selposx %selposy
goto crafting_loop
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX SUB TO FIND AND RETURN RESOURCES XXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub clear_pack
finditem %resources C_ , #backpackid
for %i 1 #findcnt
    {
    finditem %resources C_ , #backpackid
    exevent drag #findid #findstack
     wait 10
    exevent dropc %resource_bag
     wait 15
    }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXX SUB TO CHECK AND CRAFT TOOLS XXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub check_tool
finditem %1 C_ , #backpackid
if #findcnt >= %2
   return
set %to_make ( %2 - #findcnt ) ; Sets a number of tools to make
set #lobjectid #findid
; --------------------------------
; This section looks for ingots, then pulls 100
finditem %ingot_type C_ , %resource_bag
for #findindex 1 #findcnt
    {
    event property #findid
    if copper || shadow || bronze || agapite || gold || verite || valorite in #property
     ignoreitem #findid
    if ingots in #property && shadow notin #property
    set %ingots #findid    ; Finds only Iron Ingots
    }
finditem %ingots C_ , %resource_bag
if #findcnt < 20
   {
   display ok You are out of ingots.$
           +Please get more and resetart script.
   gosub return_resources
   halt
   }
finditem %ingots C_ , %resource_bag
exevent drag #findid 100
 wait 10
exevent dropc #backpackid
 wait 15
; --------------------------------
; Makes tool required, and loops %to_make (number of tools needed) times
event macro 22 0
  gosub gumpwait
 set %x #contposx + %3
 set %y #contposy + %4
 click %x %y ; Selects Category
  gosub gumpwait
for %i 1 %to_make
 {
 set %x #contposx + %5
 set %y #contposy + %6
 click %x %y ; Selects Tool
  gosub gumpwait
 }
gosub clear_pack
finditem %1 C_ , #backpackid
if #findcnt < %2
   gosub check_tool
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX SETS ITEMS NEEDED FOR EACH POTION XXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub potion_init
menu get %pot_to_make
if #menuRes = 1 ; Total Refreshment
   {
   set %reagent1 KUF ; Black Pearl
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 90
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 2 ; Greater Agility
   {
   set %reagent1 JUF ; Bloodmoss
   set %reagent2 N/A ; N/A
   set %required_reagent1 3
   set %required_reagent2 N/A
   set %catposy 110
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 3 ; Night Sight
   {
   set %reagent1 RZF ; Spider's Silk
   set %reagent2 N/A ; N/A
   set %required_reagent1 1
   set %required_reagent2 N/A
   set %catposy 130
   set %selposy 70
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 4 ; Greater Heal
   {
   set %reagent1 JZF ; Ginseng
   set %reagent2 N/A ; N/A
   set %required_reagent1 7
   set %required_reagent2 N/A
   set %catposy 150
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 5 ; Greater Strength
   {
   set %reagent1 MZF ; Mandrake Root
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 170
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 6 ; Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 2
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 7 ; Greater Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 4
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 8 ; Deadly Poison
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 8
   set %required_reagent2 N/A
   set %catposy 190
   set %selposy 130
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 9 ; Greater Cure
   {
   set %reagent1 KZF ; Garlic
   set %reagent2 N/A ; N/A
   set %required_reagent1 6
   set %required_reagent2 N/A
   set %catposy 210
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 10 ; Greater Explosion
   {
   set %reagent1 WZF ; Nightshade
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 230
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 11 ; Greater Conflagration
   {
   set %reagent1 TZF ; Grave Dust
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 250
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 12 ; Greater Confusion Blast
   {
   set %reagent1 YZF ; Pig Iron
   set %reagent2 N/A ; N/A
   set %required_reagent1 10
   set %required_reagent2 N/A
   set %catposy 250
   set %selposy 130
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 13 ; Invisibility
   {
   set %reagent1 JUF ; Bloodmoss
   set %reagent2 WZF ; Nightshade
   set %required_reagent1 4
   set %required_reagent2 3
   set %catposy 270
   set %selposy 70
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 14 ; Parasitic
   {
   set %reagent1 YWS ; Parasitic Plant
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 270
   set %selposy 90
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
if #menuRes = 15 ; Darkglow
   {
   set %reagent1 XWS ; Luminescent Fungi
   set %reagent2 N/A ; N/A
   set %required_reagent1 5
   set %required_reagent2 N/A
   set %catposy 270
   set %selposy 110
   menu getnum %amount_to_make
   if #menures = 0
      {
      menu delete %amount_to_make
      menu font color red
      menu text done 120 %size2 Done!
      set %size2 ( %size2 + 25 )
      set %pot_to_make ( %pot_to_make + 1 )
      set %amount_to_make ( %amount_to_make + 1 )
      return
      }
   set %amount #menures
   }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXX SUB TO FIND AND GRAB RESOURCES XXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub grab_resources
if %amount >= 100
   set %grab 100
if %amount < 100
   set %grab %amount
; Finds and grabs Bottles
finditem %bottle C_ , %resource_bag
exevent drag #findid %grab
 wait 10
exevent dropc #backpackid
 wait 15
; Finds and grabs Reagent #1
finditem %1 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
; Finds and grabs Reagent #2
finditem %2 C_ , %resource_bag
exevent drag #findid 1000
 wait 10
exevent dropc #backpackid
 wait 15
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXXXXXX SUB FOR MAKING THE POTIONS XXXXXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub craft_potion
repeat
finditem %reagent1 C_ , #backpackid
if #findcnt < %required_reagent
   gosub grab_more_resources %reagent1
finditem %1 C_ , #backpackid
if #findcnt < %2
   gosub check_tool %alch_tool %alch_tools_needed %catposx 110 %selposx 90
event macro 22 0
  gosub gumpwait
 set %x #contposx + %3
 set %y #contposy + %4
 click %x %y ; Category
  gosub gumpwait
 set %x #contposx + %5
 set %y #contposy + %6
 click %x %y ; Selection (Potion)
  gosub gumpwait
finditem %bottle C_ , #backpackid
until #findcnt = 0
gosub clear_pack
set %amount ( %amount - %grab )
if %amount = 0
   {
   menu delete %amount_to_make
   menu font color red
   menu text done 120 %size2 Done!
   set %size2 ( %size2 + 25 )
   set %pot_to_make ( %pot_to_make + 1 )
   set %amount_to_make ( %amount_to_make + 1 )
   return
   }
return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXXX GUMP WAIT SUB, ENSURES GUMP IS UP XXXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub gumpwait
set %timer #SCNT + 5
 repeat
  until #CONTNAME = generic_gump || #SCNT > %timer
if #contname <> generic_gump
   {
   event macro 17 0
   }
Return
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; XXX TRAILMYX'S PERSISTANT VARIABLE SUBS XXX
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sub TM_GetPersistantVariable
  set #RESULT %1 , _ , #CHARID
  set #RESULT * . #RESULT
return #RESULT
sub TM_SetPersistantVariable
  set #RESULT %1 , _ , #CHARID
  set * . #RESULT %2
return











116
Script Debug / Issue with "for..." command
« on: July 07, 2008, 07:15:36 PM »
I'm attempting to write out a sub while using the for command.  What I have is a bag full of ore, and I count how much is in the bag, then set the number to %count.
Then use this line:
for %i 1 %count

It should repeat as many times as I have ore in the bag, at least thats how I understood the information on EasyUO.

Here is the sub I have written so far.  My issue is it repeats the sub twice, then moves on.
Code: [Select]
sub id_ore
finditem %ore_type C_ , %ResourcesChest
set %count #findcnt
for %i 1 %count
    {
    finditem %ore_type C_ , %ResourcesChest
    set #ltargetid #findid
    set #ltargetkind 1
    if #findcol = %iron_color
       {
       set %iron_ore #ltargetid
       ignoreitem #ltargetid
       }
    if #findcol = %dull_color
       {
       set %dull_ore #ltargetid
       ignoreitem #ltargetid
       }
    if #findcol = %shad_color
       {
       set %shad_ore #ltargetid
       ignoreitem #ltargetid
       }
    if #findcol = %copp_color
       {
       set %copp_ore #ltargetid
       ignoreitem #ltargetid
       }
    if #findcol = %brnz_color
       {
       set %brnz_ore #ltargetid
       ignoreitem #ltargetid
       }
    if #findcol = %gold_color
       {
       set %gold_ore #ltargetid
       ignoreitem #ltargetid
       }
    if #findcol = %agap_color
       {
       set %agap_ore #ltargetid
       ignoreitem #ltargetid
       }
    if #findcol = %veri_color
       {
       set %veri_ore #ltargetid
       ignoreitem #ltargetid
       }
    if #findcol = %valo_color
       {
       set %valo_ore #ltargetid
       ignoreitem #ltargetid
       }
    }
return

117
Character skill advancement / Guadah's Magery Trainer
« on: June 10, 2008, 02:41:57 AM »
Code: [Select]
; ############################################
; Script Name: Guadahs Magery Trainer 2.0
; Author: Guadah
; Version: 2.0.7
; Client Tested with: EA 7.0.16.1 (Patch 53)
; EUO version tested with: 1.5 Version 198
; Shard OSI / FS: OSI Servers
; Revision Date: 08-12-2011
; Public Release: 10-08-2007
; Purpose: To Train Magery from 25.0 to 120.0
;
; Special Thanks:
;  - TrailMyx   Advanced Journal Scan Subs
;  - Cake2      Support and Recommendations
;  - Luser      Suit_Properties Sub
; ############################################

Title:  Guadah's Magery Trainer

Skill(s) Trained:
 * Magery
 * Meditation (secondary)
 * Evaluating Intelligence (secondary)

Set-up Difficulty:  Minimal

Comments:
This script is designed to count your Lower Reagent Cost, Lower Mana Cost, Faster Casting & Fast Cast Recovery.  In the early stages I had a smart casting built in that would auto adjust after you started, now in the later stages the script will cast at the top maximum speed depending on your Faster Casting & Fast Cast Recovery.  LRC & LMC do not matter for the script performance anymore, but I still count and display them for cosmetics.

Recomendations:  Use a 100% Lower Reagent Suit with 40% Lower Mana Cost & 3-6 Casting (Use a Magic Wand with -27 or higher, which will lower you to 2-6 Casting).  If you can get Mana Regeneration of at least 8 on your suit, you will have the best results possible during training.

Menu Image:


Updates:
06-10-2008 @ 06:50am
Modified some code, updated meditation etc.
06-10-2008 @ 06:50am
ScriptUO Public Release v2.0.3

Current Version: v2.0.4

118
New member introductions / Guadah's back in town!
« on: June 10, 2008, 02:12:40 AM »
Hey hey :D

I love the color scheme of the site TM!  I'll be trolling around here daily, and look forward to what you have going on here.

For those who don't know me, I am Guadah!  I consider myself a novice coder, and do it for the pure enjoyment of it all.  Its something that is somewhat new to me, but I will be attending ITT for just this starting in the Fall.  I have a number of scripts currently out in circulation, and hope that I can contribute those to this site.

I play on the Atlantic shard, and am the GM of my guild located there.  We tend to play all aspects of the game, but focus more on Felucca vs the other facets.  Although we are not a massive guild numbers wise, we do tend to do a number of champ spawns each day, and hold our own in PvP if the numbers are fair.

Anyways, I want to say Thanks to TM for hosting and opening this site up to the public.  I will be passing this site on to my friends as well.

- Guadah

119
Off Topic / I want to have TM's babies!
« on: June 09, 2008, 02:36:23 PM »
In a non-brokeback way, if thats possible!

Pages: 1 ... 6 7 [8]