Log in

View Full Version : Nitty Gritty syntax



Suhami
05-27-2016, 11:34 AM
Hello forum,

I just came back after a two year break and I mostly forgot how to script in lich :T
I've run into an error using wait_while, this is the code:


start_script 'crossbow'
wait_while running? 'crossbow'

I've also tried it like this: wait_while( running? 'crossbow')
It looks like it should work, but it's giving me this error:

--- Lich: error: no block given (yield)
C:/Users/Documents/lich/lich.rbw:4909:in `wait_while'

On an unrelated note, I'm also wondering which script commands are the most useful for matching REs, taking variables out of REs, and related syntax.

Gnomad
05-27-2016, 11:44 AM
Just use Script.run(script, arg_string) instead of that wait_while.

Most people use string =~ regexp and the global match variables. http://ruby-doc.org/core-2.0.0/Regexp.html#class-Regexp-label-Special+global+variables http://regexr.com

m444w
05-27-2016, 12:55 PM
wait_while {
# this is a block because brackets (hence the no block given error)
running? "script"
}

Suhami
05-27-2016, 02:21 PM
Oh right, the brackets; completely forgot about those.

I think I know what I'm doing now. Thanks