• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

[Tech Help] Some serious API docs?

P

pgcd

Guest
For the third time in as many attempts, I find myself unable to complete my script because I don't know how to do what I need to do - this time it's the DragSlot* functions, last time it was the targeting system etc.
It's very possible that I'm just too dumb to figure out myself how to do stuff, but I feel that some kind of actual documentation would be nice, especially about all those bits that are not exactly obvious. Would it be too much to ask for?

A few examples of what I mean:
- Is there any way of knowing what equipment slot would the currently selected item take?
- Is there any way of assigning a different target container to DragSlotAutoPickupObject()?
- Is there any way of invoking a macro from LUA?
- Is there any way of using an object from LUA?
- Is there any way of reacting to specific chat window lines?
etc etc.
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
There is some documentation included in the CustomUIDocumentation zip.
That's all we have, aside from trial-and-error.

I would like to add some modder-written API to the Modders Exchange though... perhaps we could start here?

Let's start with the big question... what kind of format would everybody prefer?
 
P

pgcd

Guest
There is some documentation included in the CustomUIDocumentation zip.
That's all we have, aside from trial-and-error.
The one i have is the Kingdom Reborn one - I hope there was some overwrite issue and it's not the actual, current one?

As for the docs format, html has my vote.
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
While the CustomUIDocumentation file says Kingdom Reborn, it is actually updated for the Enhanced Client.

And I didn't mean file format - I meant organization. Do you want it to be like what is in the Custom UI Documentation file? Or more like Javadocs? Or some other kind of style?
 

lucitus

UOEC Modder
Stratics Veteran
Stratics Legend
For the third time in as many attempts, I find myself unable to complete my script because I don't know how to do what I need to do - this time it's the DragSlot* functions, last time it was the targeting system etc.
It's very possible that I'm just too dumb to figure out myself how to do stuff, but I feel that some kind of actual documentation would be nice, especially about all those bits that are not exactly obvious. Would it be too much to ask for?

A few examples of what I mean:
- Is there any way of knowing what equipment slot would the currently selected item take?
- Is there any way of assigning a different target container to DragSlotAutoPickupObject()?
- Is there any way of invoking a macro from LUA?
- Is there any way of using an object from LUA?
- Is there any way of reacting to specific chat window lines?
etc etc.
- make a table where you read out all items, if it carried up, the interface knows the source id
- auto dragging from one to other container, maybe possible, look at the auto loot function
- invoking macros from lua isnt possible (extra security reasons)
- using objects from lua is also blocked same reasons
- yep you can retrieve all chat by using the SystemData.Events.TEXT_ARRIVED event
and the
Code:
	-- Debug.PrintToDebugConsole(L"text arrived "..SystemData.Text)
	-- Debug.PrintToDebugConsole(L"source id "..SystemData.TextSourceID)
	-- Debug.PrintToDebugConsole(L"channel id "..SystemData.TextChannelID)
	-- Debug.PrintToDebugConsole(L"source name "..StringToWString(SystemData.SourceName))
	-- Debug.PrintToDebugConsole(L"color "..SystemData.TextColor)
tables

if you want to see what is all stored in the windowdata tables, use the ggmanagertabletostring function, also search in the uokr forum there are many things posted.
 
P

pgcd

Guest
While the CustomUIDocumentation file says Kingdom Reborn, it is actually updated for the Enhanced Client.

And I didn't mean file format - I meant organization. Do you want it to be like what is in the Custom UI Documentation file? Or more like Javadocs? Or some other kind of style?
Sorry, I didn't realize you meant *that* format... That API_ALL_ROOT page you mention is great if you already know what you're looking for, but something with a more task-oriented structure would be more useful, I think. I can't think of any examples off the top of my head right now, though.


lucitus said:
- make a table where you read out all items, if it carried up, the interface knows the source id
I don't think I understand: what items should I read and from where, and how does the id of the object help me in knowing the equipment slot it would take *before* it's there?
The objective of this is to allow stuff like before/after comparison for armor pieces: if i'm looking at a gorget on a vendor, I want to see what would my resists be using that instead of the gorget I'm wearing.
Right now, unless I go crazy and manually enter all the objecttypes => eq_slot pairs (which is not going to happen), I see no way of knowing that a gorget takes that slot and that slot is currently occupied by that other gorget.


lucitus said:
- auto dragging from one to other container, maybe possible, look at the auto loot function
That's exactly what I've done and precisely the reason why I'd like to see some docs for the API, because the autoloot function only sets the object ID, and I'd like to also set the container ID.


As for not allowing object usage and macros from LUA, it's just silly. It's not as if a certain, unnamable program won't ever work with SA - the unattended macroing problem should be solved with more GM presence etc, not by making it impossible for me to, E.G., invoking one of two different macros depending on some external condition (my current predicament: why do all my weap equip macros have to include a 1.2 sec delay when it's only required when passing from 1H to 2H weapons and viceversa?)
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
- using objects from lua is also blocked same reasons
Not true.

Code:
UserActionUseItem( objectID, true )
Uses the object specified by objectID. Not sure what the true flag is for, or what happens if you pass false. It follows the same rules as double-clicking an item - you need to have access to it, need to wait between uses, etc.


And while you might not be able to execute a macro directly... you can execute something in a hotbar slot:
Code:
HotbarExecuteItem(hotbarId, itemIndex)
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
Code:
DragSlotSetObjectMouseClickData(objectID, SystemData.DragSource.SOURCETYPE_CONTAINER)
DragSlotDropObjectToContainer( containerID, 0 )
:thumbsup:

Note: You might need to force a delay in-between those, I tested using script commands.
 
P

pgcd

Guest
Code:
DragSlotSetObjectMouseClickData(objectID, SystemData.DragSource.SOURCETYPE_CONTAINER)
DragSlotDropObjectToContainer( containerID, 0 )
:thumbsup:

Note: You might need to force a delay in-between those, I tested using script commands.
I had found this as well but I feel like the delay is a hack, since the autoloot function doesn't use one...
Anyway, thanks for the hints and solutions but, still, I think it shouldn't be you being smart and finding stuff, it should be the devs taking a few days (after the well-deserved post-SA holidays, ok) to concoct a full API reference. IMHO, of course.
 
P

pgcd

Guest
Code:
DragSlotSetObjectMouseClickData(objectID, SystemData.DragSource.SOURCETYPE_CONTAINER)
DragSlotDropObjectToContainer( containerID, 0 )
:thumbsup:

Note: You might need to force a delay in-between those, I tested using script commands.
Uhm, after a while, I think this doesn't work, except with script commands. Which brings me back to the original point: can we/I have some help from actual devs about this kind of stuff?
 
P

pgcd

Guest
Code:
DragSlotSetObjectMouseClickData(objectID, SystemData.DragSource.SOURCETYPE_CONTAINER)
DragSlotDropObjectToContainer( containerID, 0 )
:thumbsup:

Note: You might need to force a delay in-between those, I tested using script commands.
Again on this: the only way this half-works is by having the drop happen in UpdatePickupTimer, and I can't make it work like it should (i.e. like AutoPickup) - the item has to be actually dragged a little and then it drops in your bag.

Since other players are interested, would the very nice BTeng help us out?
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
Uhm, after a while, I think this doesn't work, except with script commands. Which brings me back to the original point: can we/I have some help from actual devs about this kind of stuff?
I can get it to work through scripts... the trick is you need to move the mouse in between the two calls.

Unfortunately, I can't find anything that moving the mouse might trigger, or a way to pretend the mouse moved.
 
Top