I wrote a small raw script for xAP Floorplan to send a message whenever it detects that status message:
Sub Main()
status=xap.getfromraw(rawmessage, "User.Status,xstatus")
user=xap.getfromraw(rawmessage, "User.Status,username")
' replace w/ your user name
if user= "yahoo_house_xyz@yahoo.localhost" then
' save status in global in case you want to use it somewhere else
SetGlobal "IMHouse", status
if Len(status) < 2 then
xAPBody="line1=wake myself up ping"
' replace w/ your user name
xAPTarget="mi4.jabber.jabber:yahoo_house_xyz.yahoo.localhost"
' the following 3 lines need to be all 1 line
x=xap.SendxAP("display.text" & chr(10) & "{" & chr(10) &
xAPBody & chr(10) & "priority=1" & chr(10) & "}" &
chr(10),"message.display",xAPTarget)
end if
end if
end sub
I saved it as jabberstatus.txt. The next step was to trigger this every time xstatus changed. Following this Floorplan example, I created a raw device for Jabber in floorplan. I filled in the fields as follows:
- Alias = jabber status
- Source = mi4.jabber.jabber
- Class = Messenger.Event
- Section = User.Status
- Item = xstatus
- Script to run on update = jabberstatus
No comments:
Post a Comment