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

Pages: 1 ... 3 4 [5]
61
Script Debug / Re: Help with script, am I heading int he right direction
« on: August 11, 2011, 03:18:23 PM »
AHH I see, I need to start thinking more simpler :) thanks

62
Scripting Chat / Re: Help wanted.
« on: August 11, 2011, 03:16:07 PM »
Hi bodfather

I just started to learn to script also.

If you take a look at this post http://www.scriptuo.com/index.php?topic=8176.0

there is some code there of a script that will move certain types of items from your loot bag to any container you select as long as its close enough for you to open it.
the script is really well commented out and you can see exactly what the script is doing.

Also there is a couple of tutorials here that are great also.

http://www.scriptuo.com/index.php?board=128.0


63
Script Debug / Re: Help with script, am I heading int he right direction
« on: August 11, 2011, 03:07:57 PM »
I finished the script and its working like a charm.
I changed the menu layout and some of the if statments so I could dump just one type of item without the script asking me to set the other types of bags.

I,d like to add a move all button would I just be able to make a sub with the line
Code: [Select]
;======= Move miscellaneous  Sub =======
sub movemisc
repeat
finditem %gems %reagents %ingredients %misc  C_ , %lootbag
exevent drag #findid #findstack
wait 10
exevent dropc %miscbag
wait 10
until #findcnt < 1
Display All Done!
return
;======= End Sub =======


Here is a fully working version of the script.

;----------------------------------------------------
; First off, we should start the script by setting the
; variables we're going to use. As you know, standard
; variables always start with '%'. So let's set the ones
; we're going to use!
;----------------------------------------------------
set %gems HVF_UVF_FVF_EVF_OVF_VUF_GVF_RVF_BVF_VVF_NVF_ZVF_UWS_AXS_TWS_VWS_GXS_ZWS_FXS_WWS_
set %reagents KUF_JUF_KZF_JZF_MZF_WZF_RZF_SZF_DUF_TZF_UZF_YZF_IUF_NZF_JIY_OZF_GUF_
set %ingredients KZGB_EZGB_DZGB_TDHB_SDHB_TCHB_UDHB_HDHB_ICHB_MBHB_XYGB_VWS_YCHB_XCHB_RDHB_ZIY_AZGB_TKR_YWS_NDHB_ZYGB_JZGB_UKR_IDHB_JDHB_WCHB_WWS_XWS_WKR_YYGB_MD_UCHB_QDHB_
;Add youe own item types here on the next line
set %misc XVH_
;-------------------------------------------------------------
; I just copied the gems and reagents types from the code you
; posted on SUO. Saved me some time! :)
; Now, even though we're going to use the menu to define
; the bags' id's, we should start the script off by setting
; the vars we're going to use to N/A. This has two basic
; purposes:
; First one is so that the user sees the bags N/A in the menu,
; making it easier for him to realize he has to set the bags.
; You should always think on ways to make the script more
; intuitive for people who will be using it.
; Remember, not every person who is going to use your script
; is gonna be a rocket scientist! :))
; Second purpose is so that we can put a check to see if the bag
; has been set or not in the menu, before the script starts
; doing it's job of moving items.
; So let's get those N/A's going!
; (actually, if you don't specify the vars, they will be 'set'
; automatically to N/A, but I've wrote it like this
; to ilustrate better what I'm trying to show you! :)
;-------------------------------------------------------------
set %lootbag N/A
set %gemsbag N/A
set %regsbag N/A
set %ingredientsbag N/A
set %miscbag N/A

;--------------------------------------------------
; Next, the most basic yet very important thing you should
; know is how subs work. You always use 'gosub subname'
; to go to a sub, however, you should only get out
; of a sub using 'return'. This will take you
; back to where the sub was called in the
; first place (the gosub line).
;
; The example we're gonna see now shows this
; clearly. We're gonna generate the menu for the
; user. We'll use a sub for that!
; So first things first.
;-----------------------------------------------------
gosub menu ; This line here will take you to the sub called
; 'menu'. If you scroll down you can find this sub, and
; you'll notice the last line of it being 'return'.
; So that return will take us back exactly here, where
; we used the 'gosub' command.
;----------------------------------------------------
; Ok, so now our pretty little menu should be built, and the
; user should be seeing it right now! YAY! \0/
; Now, we have to make the script wait here until the
; user clicks something to do whatever the hell he wants
; to have the script do for him. We're going to write
; a little loop to do this. Read this loop carefully
; to see how it works.
;----------------------------------------------------

repeat
if #menubutton = setloot_button
   {
   gosub setloot
   set #menubutton N/A
   }
if #menubutton = setgems_button
   {
   gosub setgems
   set #menubutton N/A
   }
if #menubutton = setregs_button
   {
   gosub setregs
   set #menubutton N/A
   }
if #menubutton = setingredients_button
   {
   gosub setingredients
   set #menubutton N/A
   }
if #menubutton = setmisc_button
   {
   gosub setmisc
   set #menubutton N/A
   }
if #menubutton = moveregs_button
   {
   if %regsbag <> N/A && %lootbag <> N/A
      {
      gosub moveregs
      set #menubutton N/A
      }
   }
   
if #menubutton = movegems_button
   {
   if %gemsbag <> N/A && %lootbag <> N/A
      {
      gosub movegems
      set #menubutton N/A
      }
   }
if #menubutton = moveingredients_button
   {
   if %ingredientsbag <> N/A && %lootbag <> N/A
      {
      gosub moveingredients
      set #menubutton N/A
      }
   }
if #menubutton = movemisc_button
   {
   gosub movemisc
   set #menubutton N/A
   }
until
;--------------------------------------------------
; Ok, our main loop is done. When the user clicks
; a button, we can see that in the #menubutton
; var. Things you should notice here:
; 1) If a button is pressed, you will go to a sub
;    which will perform what the button suggests.
;    Also, you will set the #menubutton var back to
;    N/A so that you don't keep looping like crazy
;    the same sub over and over.
; 2) If the person tries to use the move subs
;    without having set the ID's of the bags first,
;    the script will warn them about it, and go back
;    to the loop to wait for the bag id's to be set.
;----------------------------------------------------
; I guess now that this is done, we can start building the
; rest of our subs! Let's start with the sub to set
; our loot bag!
;------------------------------------------------------

;======= Set Loot Bag Sub =======
sub setloot
event SysMessage Target your loot bag ; event SysMessage will display a msg inside you client for you
      set #targcurs 1 ;sets the little target cursor on
      while #targcurs = 1 ; while #targcurs = 1, so while the target cursor is on, it will wait
      wait
      set %lootbag #ltargetid ; once the bag is clicked, we will set it's id
      set #lobjectid #ltargetid ; here we will set the last object to the id of the last target, in this case, our loot bag
      event macro 17 ; event macro 17 is 'Use Last Object', so this will open our loot bag
      menu Edit EUOEdit1 84 44 57 %lootbag
      wait 20
return
;======= End Sub =======

;--------------------------------------------------------
; Noticed the line 'menu Edit EUOEdit1 84 44 57 %lootbag' there?
; This will update the Edit Box for the lootbag in the menu,
; which will now show the id of our dear lootbag!
; Great stuff! Now we're gonna do almost the same thing for
; our other two bags. The difference is, we're not gonna want to open them.
; Why, do you ask? Simply because it would make this more complicated.
; So it's best to leave bags we're going to put stuff IN closed, while
; the bags we're going to get stuff FROM should remain open.
; So, let's do this now!
;---------------------------------------------------------

;======= Set Gems Bag Sub =======
sub setgems
event SysMessage Target your gems bag
      set #targcurs 1
      while #targcurs = 1
      wait
      set %gemsbag #ltargetid
      set #lobjectid #ltargetid
      event macro 17
      menu Edit EUOEdit2 84 72 57 %gemsbag
return
;======= End Sub =======

;======= Set Regs Bag Sub =======
sub setregs
event SysMessage Target your regs bag
      set #targcurs 1
      while #targcurs = 1
      wait
      set %regsbag #ltargetid
      set #lobjectid #ltargetid
      event macro 17
      menu Edit EUOEdit3 84 104 57 %regsbag
return
;======= End Sub =======

;======= Set set ingredients Sub =======
sub setingredients
event SysMessage Target your ingredients bag
      set #targcurs 1
      while #targcurs = 1
      wait
      set %ingredientsbag #ltargetid
      set #lobjectid #ltargetid
      event macro 17
      menu Edit EUOEdit4 330 44 57 %ingredientsbag
return
;======= End Sub =======

;======= Set set ingredients Sub =======
sub setmisc
event SysMessage Target your miscellaneous  bag
      set #targcurs 1
      while #targcurs = 1
      wait
      set %miscbag #ltargetid
      set #lobjectid #ltargetid
      event macro 17
      menu Edit EUOEdit5 330 72 57 %miscbag
return
;======= End Sub =======

;--------------------------------------
; Piece of cake right? Now, we should write up
; the move subs. So lets get it done!
;----------------------------------------

;======= Move Regs Sub =======
sub moveregs
repeat ; it will repeat whatever is written here, until the condition on the 'until' line is met
finditem %reagents C_ , %lootbag ; this will look for the reagents inside you're lootbag
exevent drag #findid #findstack ; #findstack will hold the amount of reagents in each stack
wait 10
exevent dropc %regsbag ; this line will drop the regs inside your regs bag
wait 10
until #findcnt < 1 ; if you can't find any more items, it will stop repeating!
Display All Done!
return
;======= End Sub =======

;======= Move Gems Sub =======
sub movegems
repeat
finditem %gems C_ , %lootbag
exevent drag #findid #findstack
wait 10
exevent dropc %gemsbag
wait 10
until #findcnt < 1
Display All Done!
return
;======= End Sub =======

;======= Move ingredients Sub =======
sub moveingredients
repeat
finditem %ingredients C_ , %lootbag
exevent drag #findid #findstack
wait 10
exevent dropc %ingredientsbag
wait 10
until #findcnt < 1
Display All Done!
return
;======= End Sub =======

;======= Move miscellaneous  Sub =======
sub movemisc
repeat
finditem %misc C_ , %lootbag
exevent drag #findid #findstack
wait 10
exevent dropc %miscbag
wait 10
until #findcnt < 1
Display All Done!
return
;======= End Sub =======


;--------------------------------------
; Ok, we should be set now! If no mistake was
; made while writing, this little script
; should do what we expect from it!
; Let's hit play and find out! :))
;--------------------------------------
; Below you can check out the menu sub.
;--------------------------------------


;======= Menu Sub =======
sub menu
menu Clear
menu Window Title Blacklisted's MoveLoot
menu Window Color BtnFace
menu Window Size 442 250
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu Font Transparent #false
menu Font Align left
menu Text EUOLabel1 12 44 Loot Bag ID:
menu Text EUOLabel2 12 72 Gems Bag ID:
menu Text EUOlabel3 210 44 Ingrediants Bag ID:
menu Text EUOlabel4 210 72 Miscellaneous Bag ID:
menu Text EUOLabel5 12 104 Regs Bag ID:
menu Text EUOLabel6 12 144 Move gems to bag:
menu Text EUOLabel7 12 172 Move regs to bag:
menu Text EUOLabel8 210 144 Move ingredients to bag:
menu Text EUOLabel9 210 172 Move Miscellaneous to bag:
menu Button setloot_button 148 44 43 25 Set
menu Font BGColor Window
menu Edit EUOEdit1 84 44 57 %lootbag
menu Font BGColor BtnFace
menu Button setgems_button 148 72 43 25 Set
menu Font BGColor Window
menu Edit EUOEdit2 84 72 57 %gemsbag
menu Font BGColor BtnFace
menu Button setregs_button 148 100 43 25 Set
menu Font BGColor Window
menu Edit EUOEdit3 84 104 57 %regsbag
menu Font BGColor BtnFace
menu Button setingredients_button 390 44 43 25 Set
menu Font BGColor Window
menu Edit EUOEdit4 330 44 57 %ingredientsbag
menu Font BGColor BtnFace
menu Button setmisc_button 390 72 43 25 Set
menu Font BGColor Window
menu Edit EUOEdit5 330 72 57 %miscbag
menu Font BGColor BtnFace
menu Button movegems_button 150 144 43 25 Go
menu Button moveregs_button 150 172 43 25 Go
menu Button moveingredients_button 390 144 43 25 Go
menu Button movemisc_button 390 172 43 25 Go
  menu Show 421 270
return
;======= End Sub =======

;----------------------------------------------
; Well, I hope this could point you in the right
; direction to start writing your own scripts!
; I know we can get overwhelmed sometimes, when
; we try to read huge pages of things we
; still don't understand very well. So I hope
; this has maked things a little simpler for you!
; Cheers,
;
; frneo
;------------------------------------------------
; End Script
;------------------------------------------------


64
New member introductions / Re: Returning Veteran
« on: August 11, 2011, 04:18:23 AM »
Hi Timewalker
I played WOW for a while also but got burnout from it.

65
New member introductions / Re: New Member
« on: August 11, 2011, 04:15:32 AM »
Hi I also just returned to UO. scripting makes UO more fun.

66
Script Debug / Re: Help with script, am I heading int he right direction
« on: August 11, 2011, 04:12:50 AM »
Thanks frneo, Cerveza & camotbik :)
I'm going to go over it today and spend some time on the tutorials also. I guess i was trying to run before I could walk.
Thanks for taking the time frneo for explaining how each part works it helped  alot im adding other items to the script and ill post up the finished script.

67
Games & Game Systems / Re: BattleStar Galactica Online WriteUp.
« on: August 10, 2011, 11:54:04 AM »
I noticed this was made with UNITY3D I've seen trailers for it but not played myself yet.

68
General UO Chat / Re: Back to Brit?
« on: August 10, 2011, 11:47:21 AM »
Aye confirmed! did the same apparently banned accounts are also open again.

69
Script Debug / Re: Help with script, am I heading int he right direction
« on: August 10, 2011, 11:42:38 AM »
Thanks alot guys im going to attempt to add in a menu and made more items like scrolls and imbuing ingredients.
could you give me a quick run down of the "return" actully mean's. and also is it ok to have the "event system message" I think I read on easyuo somewhere GM's may be able scan your journel.
thanks

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

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

71
New member introductions / Re: Howdy
« on: August 10, 2011, 07:37:20 AM »
Thanks the wing I have is an Ozone Mojo. I like it because its pretty stable I dont think ive got enough flying time under my belt to upgrade yet.

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

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


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

SET %Gems HVF_UVF_FVF_EVF_OVF_VUF_GVF_RVF_BVF_VVF_NVF_ZVF_
SET %Reagents KUF_JUF_KZF_JZF_MZF_WZF_RZF_SZF_DUF_TZF_UZF_YZF_IUF_

mainloop:

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


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

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

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

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

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

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

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

73
New member introductions / Re: Howdy
« on: July 22, 2011, 05:24:15 PM »
Thanks glad too be here  :)

74
New member introductions / Howdy
« on: July 22, 2011, 03:02:58 PM »
Hi guys Blacklisted here,

I live in Scotland im 28 years young and I have been playing UO on and off for 10 years now, I have recently started playing on a free private server and im having to skill up all over again, started as a noobie mage.
after a long career in the army I have left and im about to start a BSC Degree in Games Software Development at Glasgow Caledonia University in September. I have been experimenting with Unity3d and trying to learn C#. I was lucky enough to get a seat in the 3dBuzz MMORPG Class it's been a steep but enjoyable learning curve and I hope to make games for the Iphone and Android or work within a large MMO programing team once i finish my degree. Id also like to learn to make my own UO Scripts, I keep fit and jog around 8.5 miles 3 times a week and go paragliding now and again when the weather permits and thats not to often in Scotland. Being Scottish I like a drink or 3 usually Jack and coke or Magners pear cider.

Thanks

Pages: 1 ... 3 4 [5]