Updated 2.x FFXI Service. It has gone under a lot of changes and new features. Things like FishID logging, API's for current gil, level, exps, etc. Alot has changed.
Here is how to use. This file is included when you download and install the FFXIService. It is a requirement for all scripts based off of it.
API function list:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
'FFXI Service by WyvernX
'Version 2.0.0.6
'Example on how to Declare and Use the FFXI Service Object
'================================================
'Dim oFFXIService
'on error resume next
'set oFFXIService = XUScriptPlugin.GetService("FFXiService.Service")
'if Err.number <> 0 then
' ' FFXIService didn't load
' XUScriptPlugin.staStatus.Text = "FFXIService failed to load"
'else
' on error goto 0
' Dim playerName
' playerName = getPlayerName(oFFXIService)
' XUScriptPlugin.staStatus.Text = "Player's Name is: " & playerName
'end if
'Sleep 5000
'set oFFXIService = Nothing
'Currently Implemented Functions:
'================================================
'[helpstring("method UpdateData")] HRESULT UpdateData(void);
'This does not need to be directly called, because it is called from the sub functions.
'function getFindMob(ByRef obj, name) //Returns the index of a mob if found
'function getTargetItemName(ByRef obj) //Returns the name of the item targeted
'function getPlayerName(ByRef obj) //Returns the Player's Name
'function getPlayerHeading(ByRef obj) //Returns the Player's Heading
'function getPlayerZ(ByRef obj) //Returns the Player's Z Coordinage
'function getPlayerY(ByRef obj) //Returns the Player's Y Coordinage
'function getPlayerX(ByRef obj) //Returns the Player's X Coordinage
'function getMobID(ByRef obj, index) //Returns the Mob ID for the given index
'function getMobZ(ByRef obj, index) //Returns the Mob Z for the given index
'function getMobY(ByRef obj, index) //Returns the Mob Y for the given index
'function getMobX(ByRef obj, index) //Returns the Mob X for the given index
'function getMobName(ByRef obj, index) //Returns the Mob Name for the given index
'function getMobStatus(ByRef obj, index) //Returns the Mob Status for the given index
'function getPlayerTP(ByRef obj) //Returns the Player's TP
'function getPlayerMP(ByRef obj) //Returns the Player's MP
'function getPlayerHP(ByRef obj) //Returns the Player's HP
'function getPlayerStatus(ByRef obj) //Returns the Player's Status
'function getTargetIndex(ByRef obj) //Returns the Player's Target's Index
'function getTargetHP(ByRef obj) //Returns the Player's Target's HP
'function getTargetName(ByRef obj) //Returns the Player's Target's Name
'function getPoleLeft(ByRef obj) //Returns true if the fishing pole is in the left side of the screen
'function getPoleCenter(ByRef obj) //Returns true if the fishing pole is in the center side of the screen
'function getPoleRight(ByRef obj) //Returns true if the fishing pole is in the right side of the screen
'function getFishWeight(ByRef obj) // Returns the weight of the fish. Ie moat carps = 460, Crayfish = 420.
'function putHideBadChatLogChars(ByRef obj, ByVal newVal) //Turns on or off the filter for the chat log parsing of hidden/foreign chars.
'function getHideBadChatLogChars(ByRef obj) //Gets the filter for the chat log parsing of hidden/foreign chars (true/false)
'For 1.1.0.12
'function getZoneName(ByRef obj) //Gets the current zone name
'For 1.1.1
'function getServiceVersion(ByRef obj) //Returns a string of the ffxiservice.dll version.
'For 2.0.5
'function getFishPoleHash(ByRef obj) // Returns the unique ID of the fish specific to your fishing pole.
'For 2.0.6
'function getPlayerGil(ByRef obj) //Returns the Player's current Gil
'function getPlayerExp(ByRef obj) //Returns the Player's current exp points
'function getPlayerExpNext(ByRef obj) //Returns the Player's points til next exp level
'function getPlayerLevel(ByRef obj) //Returns the Player's Level
And here are some of the status codes:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
' Player status variables, don't touch
Dim statusNone ' Character is doing nothing "special".
Dim statusFighting ' Character is fighting.
Dim statusDead ' Character is dead.
Dim statusEvent ' Character is watching an event such as talking with an NPC (multiline) or watching an airship depart.
Dim statusChocobo ' Character is riding a chocobo.
Dim statusHealing ' Character is kneeling to rest.
Dim statusFishing ' Character is fishing.
Dim statusBite ' Character just got a bite while fishing.
Dim statusObtained ' Character obtained something from fishing.
Dim statusRodBreak ' Characters fishing rod broke while trying to haul in it's catch!
Dim statusLineBreak ' Characters fishing rod line broke while trying to haul in it's catch.
Dim statusLostCatch ' Character did not catch anything or lost it's catch.
Dim statusCatchMonster ' Character just caught a monster while fishing!
Dim statusSynthing ' Character is synthesizing an item.
Dim statusSitting ' Character is sitting down.
statusNone = 0
statusFighting = 1
statusDead = 2
statusEvent = 4
statusChocobo = 5
statusFishing = 50 'Added by WyvernX for 2.23.05 Patch
statusHealing = 33
statusBite = 38
statusObtained = 39
statusRodBreak = 40
statusLineBreak = 41
statusCatchMonster = 42
statusLostCatch = 43
statusSynthing = 44
statusSitting = 47
NOTE: As of this version it has an option to log all results to a shared database that I will be unveiling very shortly. Once this version is out of beta there will be a toggle to turn on/off logging. Currently it logs to a DB, fish, exp, mobs, loot, skillups etc. We are compiling a item/fishing databse and you will be supprised.
I intend to add things like gil/hour, exps/hour etc. Ie you can login and get stats etc. Very kewl stuff.
Also in this version is a fish ID. here is how to modify XUFish to use it:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
function getFishPoleHash(ByRef obj)
on error resume next
obj.UpdateData
getFishPoleHash = obj.FishPoleHash
if (Err.Number <> 0) then
getFishPoleHash = -1
end if
on error goto 0
end function
function doBite
Dim w
w = getFishPoleHash(serviceObject)
'Get your ID's from the log after you catch one.
writeLogLine ("Caught something with ID: " & hex(w))
if (w = &H0CC8170C OR w = &H07F02424) then
'This is an example of moat carp with a yew fishing pole. or black soles with lushangs
doBite = true
else
Sleep 200
doBite = false
end if
end function
Enjoy! And give me some feedback on feature requests!
EDIT:
Here is a link to the DB logging site:
http://ffxi.mmo-info.com
Please give some feedback!