ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: OMGBurgers on December 05, 2008, 05:48:09 PM

Title: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 05, 2008, 05:48:09 PM
It's going to be a script that buys things from npcs.  Most likely resources (Reagents, Boards, Ingots, Arrows, Bolts, Boards, etc).  Just wanted to look for more input to make it as good as possible.  I want it to be able to buy anything from an npc while afk. 

So far these are the following options and a very basic idea on how itll go:

Have a list of items/resources to buy that is customizable (Add/Remove/Save) (Set max buy price)
Have a list of vendors to buy from that is customizable (Add/Remove/Save)
Drop off at bank or house
Recall via chiv or magery
Auto stop on gold spent, time, etc.
Requires giant beetle (Better carrying 1600 stones a trip than a lousy 300 or so)
Support multiple runebooks



1. check for gold and withdraw at least 2000
2. recall to next rune location
3. find vendor from list
4. open vendor
5. scroll through list & add items to cart on your shopping list
6. do a weight calculation on your beetle and the item weight database to determine how much your beetle can still hold
7. buy as much as possible in one deal
8. check beetle weight.  if it's 1600stones or the bank weight specified then bank and return to vendor.  if the vendors were empty recall to next location rather then comming back.
9. repeat over and over until X amount of gold is spent or time passed
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 05, 2008, 09:40:01 PM
I've always like stats.. how about how much you've spent, on what?
also set a limit to how much gold your willing to spend.
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 05, 2008, 10:00:03 PM
Already planned on the limit to how much you've spent.

Statistics would be nice too.  I could throw them into a listbox that get's updated as it drops things off at the bank.
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 06, 2008, 12:42:50 AM
Here's what I came up with so far for the editor.  It's kind of a big but it's only up when you want to edit your lists.

A simple rundown of the screen:

Top right section - A list of items.  This is pretty simple, you have your Item Type, the weight of it, the max price you will ever pay for it, and a description.  These values are extremely important and shouldn't be entered wrong.

Bottom right section - A list of vendors.  Again, simple.  Add the vendors and fill your database.  Since you will have multiple lists that will/can vary greatly, it's important to have a nice selection to choose from.

Left section - This is your shopping list.  You add the items & vendors you created to create "directions" for the script to run by.  Simple enough (In my opinion).


I hope I'm not missing anything (Which I probably am!).  I really don't want to edit the interface for this screen haha.  Any suggestions, possible viewed problems, etc are always welcome, as I would rather make changes sooner than later!
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 06, 2008, 08:45:21 AM
How about an inventory max?  lets say for regs I'd like to keep 5k of each reg.. once black pearl reaches 5k the shopper removes BP from the buying list?
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 06, 2008, 07:17:52 PM
How about an inventory max?  lets say for regs I'd like to keep 5k of each reg.. once black pearl reaches 5k the shopper removes BP from the buying list?

That would be cool.  I wonder where I should have that setup in?  Probably not on that screen because it's a fixed "template" list.  Maybe once you set your templates ehn you select it it goes into a list where you type in an amount of what you want stocked to.  From there I guess you can give it the option to get an ADDITIONAL X amount of units, or make your unit EQUAL to X.

Example:  You start w/ 5k black pearl, and tell it to buy an additional 7k to put you at 12k.
Example.  You start w/ 5k black pearl, you tell it to stock up to 15k, so it keep buying until it reaches 15k of it (10k is what it needs to buy).  It then removes it from the list.

If you set limits to what to buy it will auto stop once your spending limits are met, you balance empty, or your shopping list has been filled.

Good ideas people keep them comming!
Title: Re: Going to write a new script. Need some ideas.
Post by: Ultima on December 06, 2008, 09:50:18 PM
Didn't see blank scrolls on your list there but I'm sure you already have that included.

Gotta keep those Slayer Books and Scrappers flowing...

Sounds pretty intricate to create a shopping list.

I'll help test when the time comes   :)
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 07, 2008, 01:20:15 AM
yeah scrolls is the main reason i'll be writing it lol.

i'll probably release a quick version out that works, then go real hardcore on all the extra options.

reason being is i want a *bleep* pile of slayer sets to sell before the patch hits that's going to get everyone doing those ilshenar champ spawns.

i have no idea how i'm going to do the part where they write how much to stock up on etc.  I'll most likely have to make a custom list of some sort using labels and edit boxes.  reason being is it has to display thier shopping list, and then give them the option to enter how many to buy.  And you really don't what that to be a fixed number that they may need to edit over and over in thier shopping list.  it should really be quickly changeable each time they run it.

i'm thinking where the items are stored in the script, it will save additional information in it like total purchased, last amount to stop at, etc.  so that way when they load it they don't have to set it everytime, but rather it will show thier last settings, and they can choose to change it quickly or keep it the same.

maybe i'm thinking way too much into this or adding way too many options.  who knows.

one thing i promised i wont do is just take out all the general lazyness.  i can probably script it to do anything and everything.  but i should draw a line somewhere before i lose interest and never finish it like most of my scripts lol.
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 07, 2008, 01:22:37 AM
oh i was thinking of an inventory type system to use.  it's going to keep track of how much it bought and crap, but then maybe give users to adjust thier numbers for if they sell a bulk amount of it, buy a bunch, etc.  it's going to be fun!
Title: Re: Going to write a new script. Need some ideas.
Post by: TrailMyx on December 07, 2008, 01:39:30 AM
That's some crazy script you have brewing there.....  :)
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 07, 2008, 02:04:55 AM
Yeah I hope like hell I finish it :/  I would REALLY love to be using it while I'm at work lol.

Right now I'm just working on finishing that screen.  None of it's uo related which is good so it's easy to test.  Right now I'm working on the item type list and getting that done.  From there I should have all my subs needed to finish the other parts of it very quickly.

Hopefully by today maybe I can have this form at least posted up for people to mess around with and/or get a feel for it.  Then I'll slowly start on figureing out how the hell to do the main interface.  I'm not 100% happy with this one, and almost wondering if I should make the menus seperate  for the vendor list, item type list, and shopping list.  But It's kind of useful being all on one screen so you can edit them on the fly and add new things without having to save, go back to main menu, to the other editor, etc. My main thing is confusing people, but it's so easy imo and there will be better help then I ever had, I'm not sure how people won't be able to use it lmao.
Title: Re: Going to write a new script. Need some ideas.
Post by: TrailMyx on December 07, 2008, 06:24:47 AM
If it will be helpful, you might give my List Handling Subs (http://www.scriptuo.com/smf/index.php?topic=21.0) a try.  They might really simplify your list box handling, especially since I added the tag information along with the display info.

Plus they allow you to save/recall lists from file.
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 09, 2008, 01:16:47 AM
I dunno... this is just an idea?

I used TM List Handler
not everything in the code is used, i'm just to lazy to figure out which subs are being used in the handler.
Code: [Select]
gosub TM_CreateList List Newlist1 220 44 121 97 White WindowText %font_arial 8
Menu Show
GoSub ShowEUOMENU1

start:
Set #MenuButton N/A
Loop:
if #MenuButton <> N/A
Goto #MenuButton
Goto Loop
Add:
Menu Get Regreants
gosub Getregname

Goto Start

HALT

sub getregname
if #MenuRes = 1
   Set %Item Black_Pearl
if #MenuRes = 2
   Set %Item Blood_Moss
if #MenuRes = 3
   Set %Item Ginsing
if #MenuRes = 4
   Set %Item NightShade
if #MenuRes = 5
   Set %Item Mandrake_Root
if #MenuRes = 6
   Set %Item Sulpher_Ash
if #MenuRes = 7
   Set %Item Garlic
Menu Get Total
Set %Total #MenuRes
Set %Add_Item %Item , _ , %Total
GoSub AddSpace %Add_Item
gosub TM_AddToList Newlist1 #Result
return

;--------- EasyUO Menu Designer Code Begin ---------
sub showEUOMenu1
;menu Clear
menu Window Title EUOMenu1
menu Window Color BtnFace
menu Window Size 414 230
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 236 28 Shoping List Max
menu Font BGColor Window
menu Combo Create Regreants 28 44 105
menu Combo Add Regreants Black Pearl
menu Combo Add Regreants Blood Moss
menu Combo Add Regreants Ginsing
menu Combo Add Regreants NightShade
menu Combo Add Regreants Mandrake Root
menu Combo Add Regreants Sulpher Ash
menu Combo Add Regreants Garlic
menu Edit Total 140 44 73 Set , #spc , Amount
;menu List Create EUOListBox1 220 44 121 97
menu Font BGColor BtnFace
menu Button Add 140 72 31 17 Add
menu Button Delete 176 72 39 17 Delete
menu Show 421 270
return
;--------- EasyUO Menu Designer Code End ---------

;=================================================================
; Script Name: TrailMyx's List Handling Subs
; Author: TrailMyx
; Version: 0.20
; Shard OSI / FS: OSI / FS OK
; Revision Date: 3/12/2008
; Purpose: Take the pain out of managing lists
;
; Subroutines included:
;   TM_CreateList - Creates the list
;   TM_DrawList
;   TM_ReDrawList
;   TM_AddToList
;   TM_DeleteAllItemsInList
;   TM_CopyAllItemsInList
;   TM_DeleteIndexedItemInList
;   TM_DeleteExactItemsInList
;   TM_DeleteItemsInList
;   TM_SearchForExactItemInList
;   TM_SearchForItemInList
;   TM_CountExactItemsInList
;   TM_CountItemsInList
;   TM_AlphabetizeList
;
; Requirements:
;
; Locals/Globals:
;   TM_window_list_ , %2 (local)
;
; Special Thanks:
;
;=================================================================
; --- Test and sample code:
;set %font_arial MS , #SPC , Ariel
;gosub showEUOMenu1
;gosub TM_CreateList List Newlist1 10 10 100 100 White WindowText %font_arial 8
;gosub TM_LoadListFromFile c:\testlist.txt ; load a list from file
;gosub TM_ReDrawList Newlist1 ; redraw list
;gosub TM_CreateList List Newlist2 110 10 100 100 White WindowText %font_arial 8
;gosub TM_AddToList Newlist1 alpha
;gosub TM_AddToList Newlist1 gamma
;gosub TM_AddToList Newlist1 beta
;gosub TM_AddToList Newlist1 monkey
;gosub TM_AlphabetizeList Newlist1 >
;gosub TM_AddToList Newlist2 monkey
;gosub TM_DeleteItemsInList Newlist1 1 #TRUE #TRUE
;gosub TM_CopyAllItemsInList Newlist1 Newlist2 #FALSE #TRUE
;gosub TM_SaveListToFile Newlist1 c:\testlist.txt
;stop
;-----------------------------------------------------------------
sub TM_LoadListFromFile
  namespace push
  namespace local LLFF
  set !filename %1
  gosub TM_FileSystem_LoadFile !filename
  namespace pop
return
;-----------------------------------------------------------------
sub TM_SaveListToFile
  namespace push
  namespace local TM_window_list_ , %1
  set !listname %1
  set !filename %2
  gosub TM_FileSystem_CreateFileHandle save_handle
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle listtype
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle listname
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle x1
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle y1
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle x2
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle y2
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle bgcolor
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle txtcolor
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle font
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle fontsize
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle fontstyle
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle draw
gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle list_ptr

for !j 0 !list_ptr
  gosub TM_FileSystem_SaveVariable local TM_window_list_ , !listname save_handle list , !j

gosub TM_FileSystem_SaveFile save_handle !filename
set #RESULT !listname
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_CreateList
  namespace push
  namespace local TM_window_list_ , %2
  namespace clear
  set !listtype %1
  set !listname %2
  set !x1 %3
  set !y1 %4
  set !x2 %5
  set !y2 %6
  set !bgcolor %7
  set !txtcolor %8
  set !font %9
  set !fontsize %10
  if %0 >= 11
    set !fontstyle %11
  else
    set !fontstyle N/A
  set !draw #TRUE

  if NODRAW in !listtype
    set !draw #FALSE

  if List in !listtype
    set !listtype List

  if Combo in !listtype
    set !listtype Combo

  if !draw = #TRUE
    gosub TM_DrawList !listname
  set !list_ptr 0
  namespace pop
return
;-----------------------------------------------------------------
sub TM_DrawList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  menu Font BGColor !bgcolor
  menu Font Color !txtcolor
  menu Font Size !fontsize
  menu Font Name !font
  if !fontstyle = N/A
    menu Font Style
  else
    menu Font Style !fontstyle
  menu !listtype create !listname !x1 !y1 !x2 !y2
  set !end !list_ptr - 1
  if !end >= 0
  {
    for !i 0 !end
      menu !listtype add !listname !list . !i
  }
  set #LPC !temp_LPC
  namespace pop
return
;-----------------------------------------------------------------
sub TM_ReDrawList
  namespace push
  namespace local TM_window_list_ , %1
  menu delete %1
  gosub TM_DrawList %1
  namespace pop
return
;-----------------------------------------------------------------
sub TM_AddToList
  namespace push
  namespace local TM_window_list_ , %1
  set !listname %1
  set !item %2
  set !list . !list_ptr !item
  set !list_ptr !list_ptr + 1
  set #RESULT !list_ptr
  menu !listtype add !listname !item
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_DeleteAllItemsInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  set !redraw %2
  if !list_ptr >= 0
  {
    for !i 0 !list_ptr
      set !list . !i N/A
    set !list_ptr 0
    if !redraw = #TRUE
      gosub TM_ReDrawList !listname
  }
  set #LPC !temp_LPC
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_CopyAllItemsInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname1 %1
  set !listname2 %2
  set !append %3
  set !redraw %4
  if !append <> #TRUE
    gosub TM_DeleteAllItemsInList !listname2
  if !list_ptr > 0
  {
    set !end !list_ptr - 1
    for !i 0 !end
      gosub TM_AddToList !listname2 !list . !i
    if !redraw = #TRUE
      gosub TM_ReDrawList !listname2
  }
  set #LPC !temp_LPC
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_DeleteIndexedItemInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  set !index %2 - 1
  set !redraw %3
  if !index >= 0
  {
    for !i !index !list_ptr
    {
      set !next !i + 1
      set !list . !i !list . !next
    }
    set !list_ptr !list_ptr - 1
    if !redraw = #TRUE
      gosub TM_ReDrawList !listname
  }
  set #LPC !temp_LPC
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_DeleteExactItemsInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  set !item %2
  set !deleteall %3
  set !redraw %4
  set !count 0
  for !j 0 !list_ptr
  {
    if !list . !j = !item
    {
      set !count !count + 1
      for !i !j !list_ptr
      {
        set !next !i + 1
        set !list . !i !list . !next
      }
      set !j !j - 1
      set !list_ptr !list_ptr - 1
      if !deleteall = #FALSE
        break
    }
  }
  if !redraw = #TRUE
    gosub TM_ReDrawList !listname
  set #RESULT !count
  set #LPC !temp_LPC
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_DeleteItemsInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  set !item %2
  set !deleteall %3
  set !redraw %4
  set !count 0
  for !j 0 !list_ptr
  {
    if !item in !list . !j
    {
      set !count !count + 1
      for !i !j !list_ptr
      {
        set !next !i + 1
        set !list . !i !list . !next
      }
      set !j !j - 1
      set !list_ptr !list_ptr - 1
      if !deleteall = #FALSE
        break
    }
  }
  if !redraw = #TRUE
    gosub TM_ReDrawList !listname
  set #RESULT !count
  set #LPC !temp_LPC
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_SearchForExactItemInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  set !item %2
  set !highlight %3
  for !i 0 !list_ptr
  {
    if !list . !i = !item
    {
      set #RESULT !i + 1
      if !highlight = #TRUE
        menu !listtype select !listname #RESULT
      namespace pop
      return #RESULT
    }
  }
  set #LPC !temp_LPC
  namespace pop
return #FALSE
;-----------------------------------------------------------------
sub TM_SearchForItemInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  set !item %2
  set !highlight %3
  for !i 0 !list_ptr
  {
    if !item in !list . !i
    {
      set #RESULT !i + 1
      if !highlight = #TRUE
        menu !listtype select !listname #RESULT
      namespace pop
      return #RESULT
    }
  }
  set #LPC !temp_LPC
  namespace pop
return #FALSE
;-----------------------------------------------------------------
sub TM_CountExactItemsInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  set !item %2
  set !count 0
  for !i 0 !list_ptr
  {
    if !list . !i = !item
      set !count !count + 1
  }
  set #RESULT !count
  set #LPC !temp_LPC
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_CountItemsInList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set #LPC 1000
  set !listname %1
  set !item %2
  set !count 0
  for !i 0 !list_ptr
  {
    if !item in !list . !i
      set !count !count + 1
  }
  set #RESULT !count
  set #LPC !temp_LPC
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_AlphabetizeList
  namespace push
  namespace local TM_window_list_ , %1
  set !temp_LPC #LPC
  set !eval %2
  set #LPC 1000
  set !listname %1
  if !list_ptr < 2
    goto AlphabetizeList_skip
  set !end !list_ptr - 1
  for !i 0 !end
  {
    set !next !i + 1
    if !i = !end
      break
    for !j !next !end
    {
      set !iptr 0
      str len !list . !i
      set !ilen #STRRES
      set !jptr 0
      str len !list . !j
      set !jlen #STRRES
      set !len !ilen
      if !ilen > !jlen
         set !len !jlen
      for !p 1 !len
      {
        str mid !list . !i !p 1
        gosub TM_EvaluateCharacter #STRRES
        set !c1 #RESULT
        str mid !list . !j !p 1
        gosub TM_EvaluateCharacter #STRRES
        set !c2 #RESULT
        if !c1 = !c2
          continue
        if !c1 !eval !c2
        {
          set !temp !list . !i
          set !list . !i !list . !j
          set !list . !j !temp
        }
        break
      }
    }
  }

AlphabetizeList_skip:
  set #LPC !temp_LPC
  namespace pop
return #RESULT
;-----------------------------------------------------------------
sub TM_EvaluateCharacter
  namespace push
  namespace local EVAL
  set !char %1
  set !string ! , "#$%&'()*+,- , #DOT , /0123456789: , #SMC , <=>?@[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
  str pos !string !char
  namespace pop
return #STRRES

;================================ File System ==================================
;-------------------------------------------------------------------------------
; %1 - Name of file handle name to create
sub TM_FileSystem_CreateFileHandle
  namespace push
  namespace local TM_FileSystem
  set !ptr %1 , _ptr ; {userhandle}_ptr
  set ! . !ptr 0 ; !{userhandle}_ptr (actual pointer)
  set !handle ! . !ptr
  set !handle %1 , !handle
  set ! . !handle ; assume new variable
  namespace pop
  set !TM_Function_found #TRUE
return
;-------------------------------------------------------------------------------
; %1 = namespace location (local, global)
; %2 = namespace name
; %3 = file handle name
; %4 = variable name
sub TM_FileSystem_SaveVariable
  namespace push
  namespace local TM_FileSystem
  set !ns_loc %1
  set !ns_name %2
  set !handle %3
  set !var %4
  set !sep 
  set !temp_LPC #LPC
  set #LPC 1000
  if !handle = handle
    set !handle __ , handle
  set !ptr !handle , _ptr ; {userhandle}_ptr
  set !handle_copy !handle
  if ! . !ptr = N/A
  {
    set ! . !ptr 0 ; !{userhandle}_ptr (actual pointer)
    set !handle_copy ! . !ptr
    set !handle_copy !handle , !handle_copy
    set ! . !handle_copy ; assume new variable
  }
  set !handle_copy ! . !ptr
  set !handle_copy !handle , !handle_copy
  if !ns_loc = local && !ns_name = std
    set !value % . !var
  else
  {
    namespace copy !var from !ns_loc !ns_name
    set !value ! . !var
  }
  gosub AddUnderscore !value ; must not have spaces in stored variables!!!
  set ! . !handle_copy ! . !handle_copy , !ns_loc , !sep , !ns_name , !sep , !var , !sep , #RESULT , !sep
  str len ! . !handle_copy
  if #STRRES > 2000
  {
    set !len #STRRES
    str left ! . !handle_copy 2000
    set !temp #STRRES
    str del ! . !handle_copy 1 2000
    set ! . !handle_copy !temp
    set ! . !ptr ! . !ptr + 1
    set !handle_copy ! . !ptr
    set !handle_copy !handle , !handle_copy
    set ! . !handle_copy #STRRES
  }
  set !value
  set !temp
  set #LPC !temp_LPC
  namespace pop
  set !TM_Function_found #TRUE
return
;-------------------------------------------------------------------------------
; %1 = namespace location (local, global)
; %2 = namespace name
; %3 = file handle name
; %4 = array name
; %5 = starting index
; %6 = ending index
sub TM_FileSystem_SaveArray
  namespace push
  namespace local TM_FileSystem
  set !temp_LPC #LPC
  set #LPC 10000
  set !ns_loc %1
  set !ns_name %2
  set !handle %3
  set !var %4
  set !start_index %5
  set !end_index %6
  set !sep 
  if !handle = handle
    set !handle __ , handle
  set !ptr !handle , _ptr ; {userhandle}_ptr
  set !handle_copy !handle
  if ! . !ptr = N/A
  {
    set ! . !ptr 0 ; !{userhandle}_ptr (actual pointer)
    set !handle_copy ! . !ptr
    set !handle_copy !handle , !handle_copy
    set ! . !handle_copy ; assume new variable
  }
  set !handle_copy ! . !ptr
  set !handle_copy !handle , !handle_copy
  for !i !start_index !end_index
  {
    if !ns_loc = local && !ns_name = std
    {
      set !newvar !var , !i
      set !value % . !newvar
    }
    else
    {
      set !newvar !var , !i
      namespace copy !newvar from !ns_loc !ns_name
      set !value ! . !newvar
    }
    gosub AddUnderscore !value ; must not have spaces in stored variables!!!
    set ! . !handle_copy ! . !handle_copy , !ns_loc , !sep , !ns_name , !sep , !newvar , !sep , #RESULT , !sep
    str len ! . !handle_copy
    if #STRRES > 2000
    {
      set !len #STRRES
      str left ! . !handle_copy 2000
      set !temp #STRRES
      str del ! . !handle_copy 1 2000
      set ! . !handle_copy !temp
      set ! . !ptr ! . !ptr + 1
      set !handle_copy ! . !ptr
      set !handle_copy !handle , !handle_copy
      set ! . !handle_copy #STRRES
    }
  }
  set !value
  set !temp
  set #LPC !temp_LPC
  namespace pop
  set !TM_Function_found #TRUE
return
;-------------------------------------------------------------------------------
; %1 = file handle name
; %2 = file name
sub TM_FileSystem_SaveFile
  namespace push
  namespace local TM_FileSystem
  set !temp_LPC #LPC
  set #LPC 10000
  set !LINE_LENGTH 2000 ; near DOS maximum
  set !handle %1
  set !filename %2
  if !handle = handle
    set !handle __ , handle
  set !ptr !handle , _ptr ; {userhandle}_ptr
  for !i 0 ! . !ptr
  {
    set !handle_copy !handle , !i
    set !str ! . !handle_copy
    if !i = 0
      execute cmd.exe /c echo set , #spc , ! , fileout , !i ,  #spc , !str > !filename
    else
      execute cmd.exe /c echo set , #spc , ! , fileout , !i , #spc , !str >> !filename
  }
  set #LPC !temp_LPC
  namespace pop
  set !TM_Function_found #TRUE
return
;-------------------------------------------------------------------------------
; %1 - file line variable
sub TM_ReadVariables
  set !temp %1
  set !fileoutindex 0
  set !fileout !fileout0
  TM_ReadVariables_loop1:
    gosub ReadItem ns_loc
    if #RESULT = #TRUE
      goto TM_ReadVariables_skip1
    gosub ReadItem ns_name
    if #RESULT = #TRUE
      goto TM_ReadVariables_skip1
    gosub ReadItem var
    if #RESULT = #TRUE
      goto TM_ReadVariables_skip1
    gosub ReadItem value
    if #RESULT = #TRUE
      goto TM_ReadVariables_skip1

    if !ns_loc in local_LOCAL && !ns_name in std_STD
      set % . !var !value
    else
    {
      set ! . !var !value
      namespace copy !var to !ns_loc !ns_name
    }
    goto TM_ReadVariables_loop1

  TM_ReadVariables_skip1:
return
;-------------------------------------------------------------------------------
; Passes %fileout(n) as local, #RESULT
sub ReadItem
  str pos !fileout 
  if #STRRES = 0
  {
    set !fileoutindex !fileoutindex + 1
    if !fileout . !fileoutindex <> N/A
    {
      set !fileout !fileout , !fileout . !fileoutindex
      str pos !fileout 
    }
    else
    {
      return #TRUE
    }
  }
  set !len #STRRES - 1
  str left !fileout !len
  set ! . %1 #STRRES
  set !len !len + 1
  str del !fileout 1 !len
  set !fileout #STRRES
return #FALSE
;-------------------------------------------------------------------------------
; %2 - file name
sub TM_FileSystem_LoadFile
  namespace push
  namespace local TM_FileSystem
  set !lpc #LPC
  set #LPC 10000
  set !filename %1

  for !i 0 1000
    set !fileout . !i N/A

  call !filename
  if !fileout0 = N/A
  {
    set #LPC !lpc
    namespace pop
    set !TM_Function_found #TRUE
    return #TRUE ; error
  }

  set !index 0
  gosub TM_ReadVariables ; assumes namespace TM_FileSystem

  set #LPC !lpc
  namespace pop
  set !TM_Function_found #TRUE
return #FALSE
;-------------------------------------------------------------------------------
; %1 - string to mung
sub 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 - string to mung
sub AddSpace
  namespace push
  namespace local AS
  set !tempstring %1
  AddSpace_loop1:
    str pos !tempstring _
    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 , #SPC , #STRRES
      goto AddSpace_loop1
    }
  set #RESULT !tempstring
  namespace pop
return #RESULT
; For test code:
;-----------------------------------------------------------------
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 09, 2008, 01:20:33 AM
This is what I have so far.  So far everything works but the saving/loading of the completed shopping lists.
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 09, 2008, 01:22:36 AM
yay! first downloader/beta tester!
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 09, 2008, 01:27:08 AM
just a question about weight.. now for regs, and certain other items. 1 item is 1 stone, but stacked 10 items still equals 1 stone.  did you consider that in your calculations?

also having problems updating after I add an item to the item type list.

ok.. this is whats happening.
first I added blood moss to the item type list.
then I added a vendor (Do I add the vendors full name?) brent the mage? or just brent?)
I went to add them both to the shopping list/vendor list.. nothing was in the drop down menu.
so I started to play with the edit and remove feature. I removed blood moss from the list, then I added it back. now blood moss was updated in the shopping list drop list. so now I was able to add blood moss to my shopping list.
I removed and added the mage's name like I did with blood moss, and the vendor is now in his drop menu.
so I proceeded to add a few more regs to the list.  I added black pearl and garlic to the item type list.  and I went over to the shopping list, and only blood moss is still there. so I removed garlic, and checked out the list again.  now I have two blood moss's and a Black pearl in the list. 

ok.. one more thing after I figured how how that works.

I tried to delete on the item type list, that is already in the shopping list.
then I went over to add lets stay I removed blood moss item 1, I try to add black pearl which was item 2 I get na/na/na/na since that item has been cleared now, bloodmoss is actualy black pearl. so some where item lists havn't been updated yet.  also should have some sort of security check if an item is in the shopping list then it shouldn't be removed from the item type list. sorta like TM's active looter in the claw.

that should keep you busy until I get home :)
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 14, 2008, 02:21:18 PM
Just Wondering how this is coming along.?.?
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 14, 2008, 02:44:37 PM
ohhh didn't even see this reply :P

i've been messing around with the main interface as of late.  trying to figure that out.  i'll work on producing those problems you mentioned then fixing them.  i'd like to make it so you cant remove something that's in your shopping list too, that should be easy to do and a good idea.

there is still a few things that need to be done on that menu.  for example you shouldnt be able to add two items of the same item type, so i just need to do a duplication check on the item type id, and the description so everything stays unique.

also good call on the calculations.  i totally didn't even think of that!  hmmmm.  i'll make it able to support .1 stone items and all since it will have to haha.  i dont think easyuo deals with decimal calculations so i guess i'll just have to do some adjustments in the math and all.  what a pita ;/  haha
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 14, 2008, 08:43:49 PM
Hey when I find a script that I really get into I'll Beta test until it hurts.  I think that's why TM goes on so many vacations to Vegas. 
Title: Re: Going to write a new script. Need some ideas.
Post by: TrailMyx on December 14, 2008, 09:38:49 PM
Hey when I find a script that I really get into I'll Beta test until it hurts.  I think that's why TM goes on so many vacations to Vegas. 

Man, no kidding!  Kham will test it until it bleeds!!  lol
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on December 15, 2008, 12:56:09 AM
LOL!

You really helped me though with that post and I appreciate it :)

I hope to at least have it runable in the next few days.  Most of the extra features like auto stopping and all won't be functional right away because I want to make sure the core part of it works as good as possible first lol.
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 15, 2008, 06:05:20 PM
ah Cool, Yes.. I can't wait to test it again!
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on December 30, 2008, 02:17:35 AM
OMG fall off the wagon?
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on February 20, 2009, 01:50:22 PM
wounder if OMG is bored with Wow yet.
Title: Re: Going to write a new script. Need some ideas.
Post by: TrailMyx on February 20, 2009, 02:43:18 PM
It sure is fun for a while, but man it does get booooring.
Title: Re: Going to write a new script. Need some ideas.
Post by: bendel on March 07, 2009, 04:44:47 AM
That script will be SICK !!!
Problem at the moment is the invasion on random town that a real problem :(
Title: Re: Going to write a new script. Need some ideas.
Post by: TrailMyx on March 07, 2009, 10:32:03 AM
And I'm getting really tired of the invasion carp!!
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on March 07, 2009, 12:53:49 PM
you and me both.  instead of messing up the towns that no one is in. how about start sending the npc theives or killers to LUNA. god I hate that town.
Title: Re: Going to write a new script. Need some ideas.
Post by: TrailMyx on March 07, 2009, 12:58:38 PM
you and me both.  instead of messing up the towns that no one is in. how about start sending the npc theives or killers to LUNA. god I hate that town.

Amen Brutha!  Luna should be summarily NUKED!

I miss Britain.  You'll notice it was an invasion that destroyed banksitting there.  Way to go EA!
Title: Re: Going to write a new script. Need some ideas.
Post by: Khameleon on March 07, 2009, 01:01:35 PM
well I wasn't around for the big invasions that sent people to Luna. I hope the new expansion kills luna
Title: Re: Going to write a new script. Need some ideas.
Post by: OMGBurgers on March 07, 2009, 02:15:08 PM
I just picked up some long hours at work starting this week.  I'll be working 7days, 10hour shifts so when I get home I'll be extremely tired and not want to do anything haha.  So these scripts will take a while to finish unfortunatly.  The whole "skeleton" is basically done, I just need to modify it to buy multiple items out of a list of them, and deal with the varying weights of them.  Just some math subs to write.

I'll probably be scripting again in 2-3 weeks.  If anyone has any requests/ideas for this script feel free to post them here for when I'm ready :)
Title: Re: Going to write a new script. Need some ideas.
Post by: TrailMyx on March 10, 2009, 10:32:45 AM
Enjoy that extra work!  It's getting pretty scarce out there right now.  I may have to start commuting from San Diego to Irvine.  Bleah.