ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Tidus on February 21, 2010, 02:03:47 PM
-
Currently working on this but there will be no updates til i have a working product on my end.
-
it askes me to targethte container and i do so, nothing happens.
-
Will run this tonight and lat ya know.
-
ok i get a big menu, set it to what i was after, target hte container, then the menu drops back to emepty and nothing happens. Looking good tho !!!!
-
I will give this a look over tonight as well. There are currently no working whole book filler inscription scripts out there, as they all broke with the recent craft updates and have not been fixed. This could really help fill that void.
-
i just ran the debugger in SUO... alot of fixes to be made. this will be done tonight when i get home. So be prepared for a new version.
-
i will give it a whirl in the AM.
-
Tidus,
I need tomake a few spells wall of stone. When i start it i set it to the correct type of desired scroll and place the quanity desired. I start it and target the container. It grabs a pen, blank scrolls and garlic but does not grab blood moss. The script seems to freeze at that point. So i went a little further. I reset the script and set it to all of the first level spells but only two of each, it went thru the same process but this time it grabbed several reagants and out of the desired scrolls it only made two ofthe desired 8. It made one deeble mind and one weaken. Not sure if this is ready to do it yet but it isnt putting the unused material back when the scripts says it is finished. It is getting there. I wonder if the huge menu could be compressed somehow? Great work tho.
-
Okay, To simplify Some Coding you might just use a generic sub for Supplying your resources, I'll send you mine when I get home but basics of it is this..... hell that might actually be more efficient than what I have....... (Need to add in #findcol for Items of the same type into this too...)
Anyways.....
Gosub Resource (Type) (Minimum) (Maximum)
Sub Resource
Finditem %1 C_ , #Backpackid ; Locates them in secure
set %amount_Found 0
for #findindex 1 #findcnt
{
set %Amount_Found %Amount_Found + #findstack
}
if %Amount_Found > %2
return
finditem %1 C_ , %secure ; Locates them in secure
if #findcnt < 1
display Out of Reagants
set %Amount_Drag %3 - %Amount_Found
Exevent drag #findid %Amount_Drag
wait 10
Exevent dropc #backpackid
wait 20
return
The Basic Idea behind the Script is that you check what you want to make, and enter in the quantity Right? Next I'd probably Just Get Rid of the set %Done, and just have a #findstack Check in your secure container for how many Scrolls are present.
Sub Make_Scroll
set %Done False
Finditem %Desired_Scroll C_ , %Secure
if #findstack >= %Desired_Amount
Return
Repeat
{
For %resource_Number 1 %Total_Resources
{
set %Resource %resource . %resource_number ; This is setup in your menu check
Gosub Resource %Resource (Min) (Max)
}
Gosub Craft
Finditem %Desired_Scroll C_ , %Secure
if #findstack >= %Desired_Amount
set %Done True
}
until %Done = True
Return
And then you would go through the logic you already have in place.
menu get Waterelemental
if #menures = #true
{
set %Total_Resources 3 ; Gives it a number to loop through checking the resources
set %Resource1 ;Blood moss
set %Resource2 ; Mandrake Root
set %resource3 ; Spiderssilk
menu get Waterelemental1
set %Amount_Desired #menures ; Sets quantity to check for in your secure
set %selectionx %selection6x
set %selectiony %selection6y
set %catx %cat4x
set %caty %cat4y
set %clicknext #true
gosub craftsetup
gosub Make_Scroll
}
-
T,
I am pretty raw myself, but I will help as best I can.
A couple of thoughts.
100% agree with MW's suggestions for moving stuff. Standardize the format and you can use one sub to move everything.
I was looking through your gump issues and I have not sorted them out yet, but I suspect its in the click structure you are using. I don't think you care where the gumps are on the screen and I would not bother moving them around for a craft script. You are using gump clicks, but it looks like your script assigns #ContPosX and Y to a variable %gumpx and y and uses these to perform gump clicks. The problem you are having might be that if the container, in this case the craft gump, moves, then those values will be wrong. I like the system TM has posted for gump clicks because it continually calculates the gump offset based on the current value. It won't matter if the gump moves if you are always using the current position value. I don't see much value in re-assigning container variables, but maybe I am missing something. Its at: http://www.scriptuo.com/index.php?topic=505.0;highlight=offset+click
Switching over might fix your problem.
It looks like you are hard-coding the waits after the clicks. This works fine for lots of scripts. I often see a "wait 20" or something like that in craft scripts after a gump click with a check to see if it worked. Personally I prefer a gumpwait sub that will give me a return result if the gump doesn't open within a time window. You can set the timeout to a length of time that should never occur (its a craft script!) and then if it doesn't work, then you put in code to cycle back to the beginning of the click series. I would start with sorting out your gump clicks though, as I suspect that is where things are going wrong.
Here is the structure of gumpwaits I have been using for craft scripts:
SomethingWentWrongLoop:
Gosub OffSetClick 280 450 ; make last
gosub waitforgump %cwin
if ! #result
{
Goto SomethingWentWrongLoop
}
;================== Wait for gump ======================
sub waitforgump
set %timeout #scnt + 10
while #contsize <> %1
{
wait 1
if #scnt > %timeout
{
return #false
}
}
wait %gumpwait
return #true
You also need to have defined the gumps you will use in the script and the gump wait interval in your setup like this:
set %cwin 530_507 ; Crafting window size
set %gumpwait 1 ; Increase number to slow down clicks on menus. 20 = 1 second.
As an aside, I would never start working from on a script with the menu. Although that's where most scripts start from the user side, beginning your draft work there introduces another layer of opportunity to introduce errors. Better to get the script doing what its supposed to first and then put the menus on -- although I generally never get to that!!
Ps. Just a heads up, the real coders on this board abhore goto's and don't like the loop I use in my gump-waits because you can't proof the script. If I find a cleaner way to do the same thing I will change my ways!!
-
UPDATED 09/26/2010 to V 1.3
-
I was trying to go thru and fill some of my stock on scrolls and decided to pull this n try it again. It will make a single scroll that you chose but it wont make the selected amount. It also takes a very long time to decide whats next to make.
seems to run good as far as picking and choosing the things it needs tho.
-
noticed the download link was missing was going to look over the code