Don't forget, you can log in with your Play.net account

Lich script development: Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
No edit summary
Line 19: Line 19:
|description=A large set of helper functions for common actions shared by many scripts.
|description=A large set of helper functions for common actions shared by many scripts.
|usage=
|usage=
Probably the single most useful function in this file is <code>bput</code> (short for 'blocking put').

bput is designed to be a more robust version of fput in situations where you know the desired response from the game. Unlike fput which will resend the same command repeatedly until it sees the desired message first from the game, bput only sends a given command one time (unless round time or type ahead errors occur) and then waits for the desired response. if the desired response isn't seen bput will eventually time out and echo debugging information.

This would never work because the game sends a response line "You search around..." before "Roundtime" is encountered:

<code>fput "forage grass", 'Roundtime'</code>

Similarly a command that can only succeed once can cause fput to hang. In this case, you have to deal with the failure case and just spam the command until failure in a noisy room with fput:

<code>fput "get box", 'you pick up', 'get what?'</code>

Lets you know with confidence if a box was picked up or if the item was missing:

<code>bput "get box", 'you pick up', 'get what?'</code>
|args=
|args=
|settings=
|settings=

Revision as of 19:13, 16 June 2016


Lich script libraries

These are lich scripts, but do not accomplish a task. Rather, they provide functionality that other scripts can take advantage of.

bootstrap


common

A large set of helper functions for common actions shared by many scripts.


common-crafting

A large set of helper functions for common actions related to crafting.


common-money

A large set of helper functions for common actions related to money and coins.


common-summoning

A large set of helper functions for common actions related to summoning weapons.


common-travel

A large set of helper functions for common actions related to travel.


dependency


drinfomon

Updated info tracking for use in other scripts in DragonRealms


events

Flags are simple true/false string detectors.


spellmonitor


Development tools

create_symlinks.bat

Useful if you are doing development on Windows. Set the LICH_SCRIPTS environment variable to the path to your lich/scripts/ directory.

create_symlinks.sh

Useful if you are doing development on OSX or Linux. Pass it an argument of the path to your lich/scripts/ directory.

util/calculate_new_loot.rb

Compares profiles/*-setup.yaml files against profiles/base.yaml to determine proper loot_additions and loot_subtractions settings.