Trigger class

The Trigger class represents a trigger registered with the hub.
When ever a user typed !triggername your script will be called, for more information read the The OnTrigger(iTriggerId, iUserId, bIsPm, sParameters) callback section.
Hex.Trigger() returns a new object of type Trigger.

Trigger:SetTrigger(sTrigger)

This function sets the trigger name.
Parameters:

Trigger:GetTriggerId()

This function returns the identifier of the trigger.

Lua sample code

mytrigger = Hex.Trigger()
mytrigger:SetTrigger("trigger")

-- fired when some one types "!trigger" in mainchat or in pm to hub bot
function OnTrigger(iTriggerId, iUserId, bIsPm, sParameters)
	if mytrigger:GetTriggerId() == iTriggerId then
		-- a trigger we registered is being used
		print("Lua: TrigId="..iTriggerId.." UserId="..iUserId.."Parameters="..sParameters)
	end
end

Generated on Thu Aug 21 11:24:07 2008 for HeXHub/HexScript by  doxygen 1.5.4
Site hosted by SourceForge.net Logo