SHARE
TWEET

Untitled

08wckster08 May 4th, 2020 580 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. SendMode Input
  3. #SingleInstance Force
  4. SetBatchLines -1
  5.  
  6. ;---------------LOAD ITEMS---------------
  7. IniRead, Items, items.ini
  8. Sort, Items
  9. Items := StrReplace(Items, "`n", "|")
  10.  
  11. Gui, +ToolWindow +HwndMainHWND
  12. Gui, Font, S8, Verdana
  13.  
  14. Gui, Add, ListBox, vItem h186 gItemSubmit w100 Section, % Items
  15. Gui, Add, Button, w45 gAdd section, Add
  16. Gui, Add, Button, w45 gDelete ys, Delete
  17.  
  18. Gui, Add, Text, xs+110 ym w120, Stock Level
  19. Gui, Add, Edit, vStock wp
  20.  
  21. Gui, Add, Text, wp, Location
  22. Gui, Add, Edit, wp h121 vLocation
  23.  
  24. Gui, Add, Button,  wp gSave, Save
  25.  
  26. Gui, Show, , Inventory Manager by Joseph
  27.  
  28. Return
  29.  
  30. Add:
  31.     InputBox , NewItem, , Please enter the item name, , 200, 130
  32.     If ErrorLevel
  33.         return
  34.     IniWrite, 0, Items.ini, % NewItem, Stock
  35.     IniWrite, Table # , Items.ini, % NewItem, Location
  36.    
  37.     reloadItems()
  38.    
  39.     MsgBox % NewItem " Added"
  40. return
  41.  
  42. Delete:
  43.     Gui, Submit, Nohide
  44.     If !Item{
  45.         MsgBox, Please select an item first!
  46.         return
  47.     }
  48.    
  49.     IniDelete, items.ini, % Item
  50.    
  51.     reloadItems()
  52.    
  53.     MsgBox % Item " Deleted"
  54. Return
  55.  
  56. ItemSubmit:
  57.     Gui, Submit, Nohide
  58.     If !Item
  59.         return
  60.    
  61.     IniRead, Stock, items.ini, % Item, stock
  62.     GuiControl,,Stock, % Stock
  63.    
  64.     IniRead, Location, items.ini, % Item, Location
  65.     GuiControl,,Location, % Location   
  66. Return 
  67.  
  68. Save:
  69.     Gui, Submit, Nohide
  70.     If !Item{
  71.         MsgBox, Please select an item first!
  72.         return
  73.     }
  74.    
  75.     IniWrite, % Stock, Items.ini, % Item, Stock
  76.     IniWrite, % Location, Items.ini, % Item, Location
  77.     Msgbox % Item " Saved"
  78. Return
  79.  
  80. GuiClose:
  81. GuiEscape:
  82.     ExitApp
  83. Return
  84.  
  85. reloadItems(){
  86.     global
  87.     IniRead, Items, items.ini
  88.     Sort, Items
  89.     Items := StrReplace(Items, "`n", "|")
  90.     GuiControl,, Item, |
  91.     GuiControl,, Item, % Items
  92. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top