The Dink Network

Reply to Re: What are all the keys that can be used in scripts?

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 12th 2024, 11:02 PM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
> It may be possible to achieve it with just DinkC and keeping the mouse active as a pointer, similar to the start.c script with the buttons you can press to either START, LOAD, QUIT etc.

It's a good idea, but you can't have Dink mode and mouse mod active at the same time, unfortunately (none of the normal Dink action keys on the kayboard will work while in mouse mode), so it does have to be a toggle. But toggle can work. Hopefully Seth fixes that bug, but also, that on screen keyabord idea would solve that problem of the double press, since it isn't an actual keyboard press anymore. It's an in-game button calling the script.

Also I was just thinking, bit of a crude fix until he looks into it, but if a double key press happens on every key press and not randomly, could you account for this in the script if the player is on phone (you can check the platform using get_platform, a return value of 1 or 4 would mean the player is playing on iphone or android). You can then do something like increment a variable each time and if it equals 1, kill the script instantly, so it only runs on even numbers(every second press). Could use a custom key for this so it doesn't use a global variable.

something like:
//retrieve the value, increment it and re-store it without using a global variable
int &phonefix = sp_custom("phone_fix", 1, -1);
&phonefix += 1;
sp_custom("phone_fix", 1, &phonefix);

&phonefix = math_mod(&phonefix, 2);
if (&phonefix == 1)
{
//odd number, kill this
kill_this_task();
}

I guess it's really something that shouldn't have to be fixed with DinkC though, and should be fixed by Seth, and if you add this and then it does get fixed in the engine, then you have to remove it again, unless you also enclose that entire check in a get_client_fork() and get_version() to only make it active for <= the current DinkHD version (assuming Seth will fix it in the next version).