Scrifen -- Hafen scripting API

Forum for alternative clients, mods & discussions on the same.
User avatar
b0r3d0m
Posts: 95
Joined: Sun Sep 13, 2015 2:39 pm

Re: Scrifen -- Hafen scripting API

Post by b0r3d0m »

Update!

A lot of new API functions and events were added:

- takeItem(itemName) function
- onUserInput(input) event
- waitForPf() function
- Equipory functions:
* getEquippedItems()
* equipItem(itemName)
* unequipItem(itemName)
- Chat functions and event:
* sendAreaChatMessage(msg)
* sendPartyChatMessage(msg)
* sendVillageChatMessage(msg)
* sendPrivateChatMessage(to, msg)
* onChatMessage(chat, from, msg)
algorithm
Posts: 218
Joined: Thu Aug 13, 2015 2:17 pm

Re: Scrifen -- Hafen scripting API

Post by algorithm »

b0r3d0m wrote:Update!

A lot of new API functions and events were added:

- takeItem(itemName) function
- onUserInput(input) event
- waitForPf() function
- Equipory functions:
* getEquippedItems()
* equipItem(itemName)
* unequipItem(itemName)
- Chat functions and event:
* sendAreaChatMessage(msg)
* sendPartyChatMessage(msg)
* sendVillageChatMessage(msg)
* sendPrivateChatMessage(to, msg)
* onChatMessage(chat, from, msg)
Great!! Thanks a lot for a good job!
algorithm wrote:Cape awarded? ;)
jorb wrote:Oh, for sure. Delivery 2022. ;)
Thedrah
Posts: 943
Joined: Fri Apr 08, 2011 2:20 am
Location: behind you

Re: Scrifen -- Hafen scripting API

Post by Thedrah »

is it possible to log out using this?

so to make a script that would log in to multiple characters to load curios. or to perform multiple functions such as a hunter and a butcher

edit: found out after reading through some hehe
how would a character pick up/lift an object using this?
  ▲
▲ ▲
User avatar
b0r3d0m
Posts: 95
Joined: Sun Sep 13, 2015 2:39 pm

Re: Scrifen -- Hafen scripting API

Post by b0r3d0m »

Thedrah wrote:is it possible to log out using this?
Yep, see the `logout` function.
Thedrah wrote:how would a character pick up/lift an object using this?
You can pick items like dandelions and blueberries via the `pickItem` function.
It's not possible to lift objects at the moment, I will think about it.
User avatar
b0r3d0m
Posts: 95
Joined: Sun Sep 13, 2015 2:39 pm

Re: Scrifen -- Hafen scripting API

Post by b0r3d0m »

Thedrah wrote:lift an object using this?
Added. See `liftObject` and `mapRightClick` functions to lift and place it correspondingly.
User avatar
b0r3d0m
Posts: 95
Joined: Sun Sep 13, 2015 2:39 pm

Re: Scrifen -- Hafen scripting API

Post by b0r3d0m »

Update is available.

The following API methods were added:

- getHP()
- getSpeed()
- setSpeed(speed)
- useMenuAction(hotkeys)
- craft(itemName)
- craftAll(itemName)
User avatar
b0r3d0m
Posts: 95
Joined: Sun Sep 13, 2015 2:39 pm

Re: Scrifen -- Hafen scripting API

Post by b0r3d0m »

Update is available.

New API methods were added:
- chooseFlowerMenuOption
- dropItem
- dropItemFromHand
- useItemFromHandOnObject

Fixed invalid `takeItem` function's return value and added additional checks to it.

I also changed flower menu interaction to fix a crash (you should call the `chooseFlowerMenuOption` function instead of returning an option name from the `onFlowerMenuOpen` hook now).
User avatar
stya
Posts: 1037
Joined: Wed May 21, 2014 3:13 pm

Re: Scrifen -- Hafen scripting API

Post by stya »

If I get a 'canPathTo' and 'getBarrel(contentType)' I will start using it :D

For the barrel thing you just have to check the Overlay, but I guess you guys know that already :roll:

Edit: also a 'isTileFree' or something in the same vein.
Image
User avatar
b0r3d0m
Posts: 95
Joined: Sun Sep 13, 2015 2:39 pm

Re: Scrifen -- Hafen scripting API

Post by b0r3d0m »

stya wrote:getBarrel(contentType)
Added. See the `getBarrelContent` function.
User avatar
b0r3d0m
Posts: 95
Joined: Sun Sep 13, 2015 2:39 pm

Re: Scrifen -- Hafen scripting API

Post by b0r3d0m »

Update is available:
  • New API functions added -- getMapObjectsByFullName, getBarrelLiters and getGrowthStage
  • New fullName property added to the map objects returned from the getMapObjects, getMapObjectsByFullName and getAllMapObjects functions

Return to “The Wizards' Tower”