ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Ultima on September 23, 2011, 06:24:42 PM
-
Trying to code a script to pick Blackrock off the ground into a trash barrel but it will only pick it up not toss in the trashcan. As you can tell by the looks of it this is a very complicated script:
set %trashcan BKF
finditem UVF_GWF_FWF_EWF G_2
if #FINDCNT > 0
{
event Drag #FINDID
wait 15
exevent dropc %trashcan
wait 15
What am I missing? Something very simple I imagine. ???
-
set %trashcan XXXXXXX
finditem UVF_GWF_FWF_EWF_ G_2
if #findkind <> -1
{
exevent drag #findid #findstack
wait 13
exevent dropc %trashcan
wait 13
}
You don't want to be using event and exevent together.
If you want to vacuum up everything in range, perhaps:
finditem UVF_GWF_FWF_EWF_ G_2
if #findkind <> -1
set %blackrockcount #findcnt
for !u 1 %blackrockcount
{
exevent drag #findid #findstack
wait 13
exevent dropc %trashcan
wait 13
}
-
Trying to code a script to pick Blackrock off the ground into a trash barrel but it will only pick it up not toss in the trashcan. As you can tell by the looks of it this is a very complicated script:
set %trashcan BKF
finditem UVF_GWF_FWF_EWF G_2
if #FINDCNT > 0
{
event Drag #FINDID
wait 15
exevent dropc %trashcan
wait 15
What am I missing? Something very simple I imagine. ???
It looks like %trashcan is only set to the itemtype, not the actual ID of the trashcan that you want the blackrock thrown into?
-
Have you ever used Whisp's Master of Loot
really a great program to do this and any moving!
-
if you want to do this with a trash type, you could do this following
set %trash BKF
set %blackrock UVF_GWF_FWF_EWF
finditem %blackrock G_2 ; looking for some blackrock
if #findcnt > 0 ; if found more than 0 %blackrock
{ ; open statement found more than 0 %blackrock
set %current_blackrock #findid ; set found item id as %current_blackrock
finditem %trash G_2 ; looking for trash
if #findcnt > 0 ; if found more than 0 %trash
{ ; open statement found more than 0 trash
exevent drag %current_blackrock #findstack ; drag found blackrock
exevent dropc #findid ; drop in to found trash id
wait 20
} ; close statement found more than 0 %trash
} ; close statement found more than 0 blackrock
-
id recommend you do it this way round less finditems, 2 vs #blackrock+1 finditems. but otherwise good code camotbik
set %trash BKF
set %blackrock UVF_GWF_FWF_EWF
finditem %trash G_2 ; looking for trash
if #findcnt > 0 ; if found more than 0 %trash
{ ; open statement found more than 0 trash
set %trashid #findid
finditem %blackrock G_2 ; looking for some blackrock
if #findcnt > 0 ; if found more than 0 %blackrock
{ ; open statement found more than 0 %blackrock
for #findindex 1 #findcnt
{
exevent drag #findid #findstack ; drag found blackrock
exevent dropc %trashid ; drop in to found trash id
wait 20
}
} ; close statement found more than 0 blackrock
} ; close statement found more than 0 %trash
-
Thanks guys for the feedback!
This little script will help me in as a learning experience understanding the code functions a bit more. I know I'll be looking it over and referring to it again in the future.
Good little lesson for me here.
Now hopefully my accounts won't free up for 5 seconds at a time when I recall into my Keep that has BR stored. God only knows how much is there....time to turn it in.
@Gimlet I've never heard of Whispers I'll have to check it out. I'm not sure if you can edit that to loot from the ground or not. Usually I use Jake's Mass Item mover for moving items from A to B. I'll check out Whispers though thanks.
Thanks to all who provided feedback here on the code. I do appreciate it and learned something along the way. :)
-
Final thanks guys!
There was a huge difference when logging or recalling into my Keep where all the blackrock was stored since tossing all the blackrock in the trash. My UO screen used to freeze for 5-6 seconds before it was able to load the contents of my keep when it was littered with blackrock.
With all the BR in the trash no more locking up or freezing when getting near the keep. Much better this way and some clean up points to boot.
-
That's why I kept all my blackrock stored in bugged secures
-
That's why I kept all my blackrock stored in bugged secures
And you do this, how? Details, man!
-
This script worked great, cleaned up my house nicely :) it was just what i was after
-
this is what i use:
set %secure BTTKRTD ; #backpackid ;BTTKRTD
set %trash RNNAZMD
while #true
{
finditem UVF_FWF_EWF_GWF C_ , %secure
wait 5
for #findindex 1 #findcnt
{
exevent drag #findid
wait 15
exevent dropc %trash
wait 15
}
break
}
halt
I hate blackrock
-
Freddy where were you when I needed you? You disappeared on us!
I'm all out of blackrock for the time being.
Your code looks the most of what I was trying to accomplish. I wouldn't take that as a compliment! :-\ :P
This was a good learning lesson for me. Albeit very basic...baby steps. It will help next time I try and edit something or trying and create a small sub of some kind.
-
haha yea i was kind of late to the party
I've been moving for the last week and a half, just got internet yesterday :P
-
Freddy where were you when I needed you? You disappeared on us!
I'm all out of blackrock for the time being.
Your code looks the most of what I was trying to accomplish. I wouldn't take that as a compliment! :-\ :P
This was a good learning lesson for me. Albeit very basic...baby steps. It will help next time I try and edit something or trying and create a small sub of some kind.
For pure learning experience I would have to say that Freddy code is not as good as camotbik or my modified camotbik. Why because ?
(1) camotbik code auto detects the trash can for you
(2) camotbik pulls the blackrock off the floor as was requested not a secure
(3) Freddys code has a redundant while loop and break.
Who new some much could be discuseed on such a simple task :)
But probably what you really needed was something that pulled from floor to backpack walked to trash then dumped ;)
-
-
With this sub you have 2 goals: Find blackrock and then move blackrock to trash. You really don't need compartmentalize such a basic task.
-
this is the snippet i want and takers...
Gosub PickupBlackRockFromFloor
gosub FindTrashCanAndMoveToIt
gosub SweepFloorsAndVacummCarpets
gosub WashWindowsAndCutTheGrass
gosub PerformBasicCarMaintaince
gosub CleanTheACUnit
gosub RepaintTheHouseItsLookingShabby
gosub PlaceBlackRockInTheTrashCan
halt
-
this is the snippet i want and takers...
Gosub PickupBlackRockFromFloor
gosub FindTrashCanAndMoveToIt
gosub SweepFloorsAndVacummCarpets
gosub WashWindowsAndCutTheGrass
gosub PerformBasicCarMaintaince
gosub CleanTheACUnit
gosub RepaintTheHouseItsLookingShabby
gosub PlaceBlackRockInTheTrashCan
halt
Now i feel like you are joking about my Comment:P
Well i bymyself have following Rules in Learning\Constructing Code:
- 1) Define what i want to Code
- 2) Splitting Code in Single Bigger Parts
- 3) Splitting each Big Part in smaller Parts
- 4) Develop the Code
- 5) Test the Code
- 6) Joining splitted Code in MainCode in the Bigparts
- 7) Do Code Cleaning, Synchronisize with interacting Menus
- 8) Use and maybe Add new Features
I do a lot of Business Process Modeling in my Company and using a similar system to develop bigger Code.
Advantages:
- You define your Script before you Code
- Smaller Code Subs mean its a lot of easyier to fix Bugs
Disadvantages:
- Lot of Time for predevelopment
Crome
-
yea chrome was jesting. I also follow a simular method.
For the past few weeks ive been compiling library's often of simple things... finding trashcan.. making generic and putting in my library. So far ive compliled these (but thier will be more as i strip out code from my vairous scripts)
set %ENs_Subs_RuneSpell %EN_SubScriptPath , \ENs-Subs-SpellsAndRuneBook.txt
set %ENs_Subs_Standard %EN_SubScriptPath , \ENs-Subs-Standard.txt
set %ENs_Subs_Bods %EN_SubScriptPath , \ENs-Subs-BodsAndNPCs.txt
set %ENs_Subs_NPCs %EN_SubScriptPath , \ENs-Subs-BodsAndNPCs.txt
set %ENs_Subs_Menus %EN_SubScriptPath , \ENs-Subs-Menus.txt
set %ENs_Subs_Banking %EN_SubScriptPath , \ENs-Subs-BanksAndHome.txt
set %ENs_Subs_Home %EN_SubScriptPath , \ENs-Subs-BanksAndHome.txt
set %ENs_Subs_Pets %EN_SubScriptPath , \ENs-Subs-Pets.txt
example of usage - Below Initializes all runebooks in your backpack named bank, Sets next rune/book to a random selection. Next line recalls to bank .. heals char / and or pets if needed, opens bank and any resource boxes needed. Not bad for 2 lines of code.
call %ENs_Subs_RuneSpell BookLoopSetup Bank %RuneBooks_Bank #TRUE
call %ENs_Subs_Banking BankRun