@Fenix Eldritch
@Quistess Alpha
Ok, so i was able to do this, and it works fine.
integer comChannel = 0;
integer comHandle;
default
{
touch_start(integer total_number) {
llListenRemove(comHandle);
comChannel = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
llSetTimerEvent(120.0); // 2 minute allowance for response.
comHandle = llListen(comChannel, "", llDetectedKey(0), "");
llTextBox(llDetectedKey(0), "\nPlease enter a test-string to broadcast to growl-enabled devices:\n", comChannel);
}
listen(integer channel, string name, key id, string message) {
llMessageLinked(LINK_THIS, comChannel, message, id);
llListenRemove(comHandle); // come to think of it though, you do need to remove it in the listen event as well to prevent double responses.
llSetTimerEvent(0);
}
timer()
{ llSetTimerEvent(0);
llListenRemove(comHandle);
}
}
@Quistess Alpha I tried the second code with
integer comChannel = -14523;
However, it seems my other script dont recognize it anymore. And how do i setup the other code at the same channel, this is confusing me.
This is the second code:
string PROWL_API_KEY = "6e4533e1370953e10e72d3b818b5d5dd0646475c";
string PROWL_APPLICATION = "Prowler";
string PROWL_EVENT = "Tickled!";
//////////////////////////////////////////////////////////
// INTERNALS //
//////////////////////////////////////////////////////////
default
{
link_message(integer sender_num, integer num, string str, key id) {
integer cha = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
if(num != cha) return;
string sLoad = "apikey=" + llEscapeURL(PROWL_API_KEY) +
"&" + "application=" + llEscapeURL(PROWL_APPLICATION) +
"&" + "event=" + llEscapeURL(PROWL_EVENT) +
"&" + "description=" + llEscapeURL(str);
llHTTPRequest("https://api.prowlapp.com/publicapi/add",
[HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"],
sLoad);
}
on_rez(integer num) {
llResetScript();
}
}