Hotkeys manager/maker/whatever

Codes submitted by developers and people of outpost. Come here to get codes for your client sources.
Post Reply
Cleroth
Loyal fan
Posts: 416
Joined: Wed Jun 16, 2004 7:08 pm

Post by Cleroth » Fri Apr 27, 2007 3:24 pm

Code: Select all

//0.3-> hotkeys by Cleroth
void CGame::ReadSettings()
{
 m_sMagicShortCut = -1;
 m_sRecentShortCut = -1;
 for&#40; int i=0; i<13; i++ &#41; m_sShortCut&#91;i&#93; = -1;

 HKEY key;
 DWORD dwDisp;
 UINT Result;
 DWORD Size = sizeof&#40;LONG&#41;;
	
	if&#40; RegCreateKeyEx&#40; HKEY_CURRENT_USER, "Software&#092;&#092;Siementech&#092;&#092;Helbreath&#092;&#092;Settings", 0, NULL, REG_OPTION_NON_VOLATILE, 

KEY_ALL_ACCESS, NULL, &key, &dwDisp &#41; != ERROR_SUCCESS &#41; return;

	if&#40; RegQueryValueEx&#40;key, "Magic", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 101 &#41; m_sMagicShortCut = Result - 1;
	else m_sMagicShortCut = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut0", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;0&#93; = Result - 1;
	else m_sShortCut&#91;0&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut1", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;1&#93; = Result - 1;
	else m_sShortCut&#91;1&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut2", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;2&#93; = Result - 1;
	else m_sShortCut&#91;2&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut3", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;3&#93; = Result - 1;
	else m_sShortCut&#91;3&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut4", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;4&#93; = Result - 1;
	else m_sShortCut&#91;4&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut5", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;5&#93; = Result - 1;
	else m_sShortCut&#91;5&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut6", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;6&#93; = Result - 1;
	else m_sShortCut&#91;6&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut7", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;7&#93; = Result - 1;
	else m_sShortCut&#91;7&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut8", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;8&#93; = Result - 1;
	else m_sShortCut&#91;8&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut9", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;9&#93; = Result - 1;
	else m_sShortCut&#91;9&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut10", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;10&#93; = Result - 1;
	else m_sShortCut&#91;10&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut11", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40; Result > 0 && Result < 201 &#41; m_sShortCut&#91;11&#93; = Result - 1;
	else m_sShortCut&#91;11&#93; = -1;

	if&#40; RegQueryValueEx&#40;key, "ShortCut12", 0, NULL, &#40;LPBYTE&#41;&Result, &Size&#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	if&#40;	Result > 0 && Result < 201 &#41; m_sShortCut&#91;12&#93; = Result - 1;
	else m_sShortCut&#91;12&#93; = -1;

	RegCloseKey&#40;key&#41;;
&#125;

Code: Select all

void CGame&#58;&#58;WriteSettings&#40;&#41;
&#123;
 HKEY key;
 DWORD dwDisp;
 UINT nData;
	if&#40; RegCreateKeyEx&#40; HKEY_CURRENT_USER, "Software&#092;&#092;Siementech&#092;&#092;Helbreath&#092;&#092;Settings", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &dwDisp &#41; != ERROR_SUCCESS &#41; return;

	if&#40; m_sMagicShortCut >= 0 && m_sMagicShortCut < 100 &#41; nData = m_sMagicShortCut + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "Magic", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;0&#93; >= 0 && m_sShortCut&#91;0&#93; < 200 &#41; nData = m_sShortCut&#91;0&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut0", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;1&#93; >= 0 && m_sShortCut&#91;1&#93; < 200 &#41; nData = m_sShortCut&#91;1&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut1", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;2&#93; >= 0 && m_sShortCut&#91;2&#93; < 200 &#41; nData = m_sShortCut&#91;2&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut2", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;3&#93; >= 0 && m_sShortCut&#91;3&#93; < 200 &#41; nData = m_sShortCut&#91;3&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut3", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;4&#93; >= 0 && m_sShortCut&#91;4&#93; < 200 &#41; nData = m_sShortCut&#91;4&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut4", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;5&#93; >= 0 && m_sShortCut&#91;5&#93; < 200 &#41; nData = m_sShortCut&#91;5&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut5", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;6&#93; >= 0 && m_sShortCut&#91;6&#93; < 200 &#41; nData = m_sShortCut&#91;6&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut6", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;7&#93; >= 0 && m_sShortCut&#91;7&#93; < 200 &#41; nData = m_sShortCut&#91;7&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut7", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;8&#93; >= 0 && m_sShortCut&#91;8&#93; < 200 &#41; nData = m_sShortCut&#91;8&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut8", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;9&#93; >= 0 && m_sShortCut&#91;9&#93; < 200 &#41; nData = m_sShortCut&#91;9&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut9", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;10&#93; >= 0 && m_sShortCut&#91;10&#93; < 200 &#41; nData = m_sShortCut&#91;10&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut10", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;11&#93; >= 0 && m_sShortCut&#91;11&#93; < 200 &#41; nData = m_sShortCut&#91;11&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut11", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;

	if&#40; m_sShortCut&#91;12&#93; >= 0 && m_sShortCut&#91;12&#93; < 200 &#41; nData = m_sShortCut&#91;12&#93; + 1;
	else nData = 0;
	if&#40; RegSetValueEx&#40;key, "ShortCut12", 0, REG_DWORD, &#40;LPBYTE&#41;&nData, sizeof&#40;UINT&#41; &#41; != ERROR_SUCCESS &#41;
	&#123;
 &nbsp;RegCloseKey&#40;key&#41;;
 &nbsp;return;
	&#125;
	RegCloseKey&#40;key&#41;;
&#125;

Code: Select all

//0.3-> hotkeys by Cleroth
void CGame&#58;&#58;LoadHotkeys&#40;char * cFile&#41;&#123;

char cTmp&#91;120&#93;;
int * iKey;
char iKey2&#91;20&#93;;
iKey = new int;

ZeroMemory&#40;iKey2, sizeof&#40;iKey2&#41;&#41;;

for&#40;*iKey='A';*iKey <= 90;*iKey+=1&#41;&#123;
 GetPrivateProfileString&#40;"HOTKEYS",&#40;char*&#41;iKey,NULL,cTmp,120,cFile&#41;;
 memcpy&#40; cConfigHotkeys&#91;&#40;*iKey&#41;&#93;, cTmp, strlen&#40;cTmp&#41;&#41;;
&#125;

for&#40;*iKey=VK_F1;*iKey <= VK_F12;*iKey+=1&#41;&#123;
 switch&#40;*iKey&#41;&#123;
	case VK_F1&#58;
	memcpy&#40;iKey2,"F1",2&#41;;
	break;
	case VK_F2&#58;
	memcpy&#40;iKey2,"F2",2&#41;;
	break;
	case VK_F3&#58;
	memcpy&#40;iKey2,"F3",2&#41;;
	break;
	case VK_F4&#58;
	memcpy&#40;iKey2,"F4",2&#41;;
	break;
	case VK_F5&#58;
	memcpy&#40;iKey2,"F5",2&#41;;
	break;
	case VK_F6&#58;
	memcpy&#40;iKey2,"F6",2&#41;;
	break;
	case VK_F7&#58;
	memcpy&#40;iKey2,"F7",2&#41;;
	break;
	case VK_F8&#58;
	memcpy&#40;iKey2,"F8",2&#41;;
	break;
	case VK_F9&#58;
	memcpy&#40;iKey2,"F9",2&#41;;
	break;
	case VK_F10&#58;
	memcpy&#40;iKey2,"F10",3&#41;;
	break;
	case VK_F11&#58;
	memcpy&#40;iKey2,"F11",3&#41;;
	break;
	case VK_F12&#58;
	memcpy&#40;iKey2,"F12",3&#41;;
	break;
	&#125;
	GetPrivateProfileString&#40;"HOTKEYS",iKey2,NULL,cTmp,120,cFile&#41;;
	memcpy&#40; cConfigHotkeys&#91;&#40;*iKey&#41;&#93;, cTmp, strlen&#40;cTmp&#41;&#41;;
	&#125;
	
	GetPrivateProfileString&#40;"HOTKEYS","Insert",NULL,cTmp,120,cFile&#41;;
	memcpy&#40; cConfigHotkeys&#91;VK_INSERT&#93;, cTmp, strlen&#40;cTmp&#41;&#41;;
	
	GetPrivateProfileString&#40;"HOTKEYS","Delete",NULL,cTmp,120,cFile&#41;;
	memcpy&#40; cConfigHotkeys&#91;VK_DELETE&#93;, cTmp, strlen&#40;cTmp&#41;&#41;;
	
	GetPrivateProfileString&#40;"HOTKEYS","Home",NULL,cTmp,120,cFile&#41;;
	memcpy&#40; cConfigHotkeys&#91;VK_HOME&#93;, cTmp, strlen&#40;cTmp&#41;&#41;;
	
	GetPrivateProfileString&#40;"HOTKEYS","End",NULL,cTmp,120,cFile&#41;;
	memcpy&#40; cConfigHotkeys&#91;VK_END&#93;, cTmp, strlen&#40;cTmp&#41;&#41;;
	
	GetPrivateProfileString&#40;"HOTKEYS","PageUp",NULL,cTmp,120,cFile&#41;;
	memcpy&#40; cConfigHotkeys&#91;VK_PRIOR&#93;, cTmp, strlen&#40;cTmp&#41;&#41;;
	
	GetPrivateProfileString&#40;"HOTKEYS","PageDown",NULL,cTmp,120,cFile&#41;;
	memcpy&#40; cConfigHotkeys&#91;VK_NEXT&#93;, cTmp, strlen&#40;cTmp&#41;&#41;;
	
&#125;

Code: Select all

//0.3-> hotkeys by Cleroth
void CGame&#58;&#58;HandleScript&#40;WORD wKey&#41;&#123;
 int i=0;
 DWORD dwTime = timeGetTime&#40;&#41;;

if&#40;wKey >= 65 && wKey <= 90&#41;
 &nbsp;if&#40; m_bCtrlPressed == FALSE &#41;
 &nbsp; return;

if&#40; cConfigHotkeys&#91;wKey&#93;&#91;0&#93; == '/'&#41;&#123;
 if&#40; m_cGameMode == DEF_GAMEMODE_ONMAINGAME &#41; &#123;
 &nbsp;ZeroMemory&#40;m_cChatMsg, sizeof&#40;m_cChatMsg&#41; &#41;;
 &nbsp;strcpy&#40;m_cChatMsg, cConfigHotkeys&#91;wKey&#93;&#41;;
 &nbsp;strcat&#40;m_cChatMsg," "&#41;;
 &nbsp;StartInputString&#40;10, 414, sizeof&#40;m_cChatMsg&#41;, m_cChatMsg&#41;; 
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "autoattack",10&#41; == 0&#41;&#123;
 if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME && &#40;!m_bInputStatus&#41; &#41;
 &#123;
 &nbsp;if&#40; m_bForceAttack &#41;
 &nbsp;&#123;
 &nbsp; m_bForceAttack = FALSE;
 &nbsp; AddEventList&#40; DEF_MSG_FORCEATTACK_OFF, 10 &#41;;
 &nbsp;&#125;
 &nbsp;else
 &nbsp;&#123;
 &nbsp; m_bForceAttack = TRUE;
 &nbsp; AddEventList&#40; DEF_MSG_FORCEATTACK_ON, 10 &#41;;
 &nbsp;&#125;
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "detail",6&#41; == 0&#41;&#123;
 if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME && &#40;!m_bInputStatus&#41; &#41; &#123;
 &nbsp;m_cDetailLevel++;
 &nbsp;if&#40; m_cDetailLevel > 2 &#41; m_cDetailLevel = 0;
 &nbsp;switch&#40; m_cDetailLevel &#41;
 &nbsp;&#123;
 &nbsp;case 0&#58;
 &nbsp; AddEventList&#40; NOTIFY_MSG_DETAIL_LEVEL_LOW, 10 &#41;;
 &nbsp; break;
 &nbsp;case 1&#58;
 &nbsp; AddEventList&#40; NOTIFY_MSG_DETAIL_LEVEL_MEDIUM, 10 &#41;;
 &nbsp; break;
 &nbsp;case 2&#58;
 &nbsp; AddEventList&#40; NOTIFY_MSG_DETAIL_LEVEL_HIGH, 10 &#41;;
 &nbsp; break;
 &nbsp;&#125;
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "map",3&#41; == 0&#41;&#123;
 if&#40; m_cGameMode == DEF_GAMEMODE_ONMAINGAME &#41;
 &#123;
 &nbsp;if&#40; m_bCtrlPressed &#41;
 &nbsp;&#123;
 &nbsp; if&#40; m_bIsDialogEnabled&#91;9&#93; == TRUE &#41; DisableDialogBox&#40;9&#41;;
 &nbsp; else EnableDialogBox&#40;9, 0, 0, 0, NULL&#41;;
 &nbsp;&#125;
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "walkrun",7&#41; == 0&#41;&#123;
 if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME && &#40;!m_bInputStatus&#41; &#41;
 &#123;
 &nbsp;if&#40; m_bRunningMode &#41; &#123;
 &nbsp; m_bRunningMode = FALSE;
 &nbsp; AddEventList&#40; NOTIFY_MSG_CONVERT_WALKING_MODE, 10 &#41;;
 &nbsp;&#125;
 &nbsp;else &#123;
 &nbsp; m_bRunningMode = TRUE;
 &nbsp; AddEventList&#40; NOTIFY_MSG_CONVERT_RUNNING_MODE, 10 &#41;;
 &nbsp;&#125;
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "music",5&#41; == 0&#41;&#123;
 if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME && &#40;!m_bInputStatus&#41; &#41;
 &#123;
 &nbsp;if &#40;m_bMusicStat == TRUE&#41; &#123;
 &nbsp; // Music Off
 &nbsp; m_bMusicStat = FALSE;
 &nbsp; if &#40;m_bSoundFlag&#41; &#123;
 &nbsp; &nbsp;if &#40;m_pBGM != NULL&#41; &#123;
 &nbsp; &nbsp; m_pBGM->bStop&#40;&#41;;
 &nbsp; &nbsp; delete m_pBGM;
 &nbsp; &nbsp; m_pBGM = NULL;
 &nbsp; &nbsp;&#125;
 &nbsp; &#125;
 &nbsp; AddEventList&#40; NOTIFY_MSG_MUSIC_OFF, 10 &#41;;
 &nbsp; return;
 &nbsp;&#125;
 &nbsp;else if&#40; m_bSoundStat == TRUE &#41; &#123;
 &nbsp; m_pESound&#91;38&#93;->bStop&#40;&#41;;
 &nbsp; m_bSoundStat = FALSE;
 &nbsp; AddEventList&#40; NOTIFY_MSG_SOUND_OFF, 10 &#41;;
 &nbsp; return;
 &nbsp;&#125;
 &nbsp;else &#123;
 &nbsp; // Music On
 &nbsp; if&#40; m_bSoundFlag &#41; &#123;
 &nbsp; &nbsp;m_bMusicStat = TRUE;
 &nbsp; &nbsp;AddEventList&#40; NOTIFY_MSG_MUSIC_ON, 10 &#41;;
 &nbsp; &#125;
 &nbsp; if&#40; m_bSoundFlag &#41; &#123;
 &nbsp; &nbsp;m_bSoundStat = TRUE;
 &nbsp; &nbsp;AddEventList&#40; NOTIFY_MSG_SOUND_ON, 10 &#41;;
 &nbsp; &#125;
 &nbsp; StartBGM&#40;&#41;;
 &nbsp;&#125;
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "to",2&#41; == 0&#41;&#123;
 if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME && &#40;!m_bInputStatus&#41; &#41;
 &#123;
 &nbsp;char tempid&#91;100&#93;, cLB, cRB;
 &nbsp;short sX, sY, msX, msY, msZ;
 &nbsp;sX = m_stDialogBoxInfo&#91;10&#93;.sX;
 &nbsp;sY = m_stDialogBoxInfo&#91;10&#93;.sY;
 &nbsp;ZeroMemory&#40; tempid, sizeof&#40; tempid &#41; &#41;;
 &nbsp;m_DInput.UpdateMouseState&#40;&msX, &msY, &msZ, &cLB, &cRB&#41;;
 &nbsp;if&#40; m_bIsDialogEnabled&#91;10&#93; == TRUE && &#40;msX >= sX + 20&#41; && &#40;msX <= sX + 360&#41; && &#40;msY >= sY + 35&#41; && &#40;msY <= sY + 139&#41; &#41;
 &nbsp;&#123;
 &nbsp; CStrTok *pStrTok;
 &nbsp; char &nbsp; * token, cBuff&#91;64&#93;;
 &nbsp; char &nbsp; seps&#91;&#93; = "&#58;";
 &nbsp; int i = &#40;139-msY+sY&#41;/13;
 &nbsp; if&#40; m_pChatScrollList&#91;i + m_stDialogBoxInfo&#91;10&#93;.sView&#93; == NULL &#41; return;
 &nbsp; if&#40; m_pChatScrollList&#91;i + m_stDialogBoxInfo&#91;10&#93;.sView&#93;->m_pMsg&#91;0&#93; == ' ' &#41; i++;
 &nbsp; strcpy&#40;cBuff, m_pChatScrollList&#91;i + m_stDialogBoxInfo&#91;10&#93;.sView&#93;->m_pMsg&#41;;
 &nbsp; pStrTok = new class CStrTok&#40;cBuff, seps&#41;;
 &nbsp; token = pStrTok->pGet&#40;&#41;;
 &nbsp; wsprintf&#40; tempid, "/to %s", token &#41;;
 &nbsp; bSendCommand&#40;MSGID_COMMAND_CHATMSG, NULL, NULL, NULL, NULL, NULL, tempid&#41;;
 &nbsp; delete pStrTok;
 &nbsp;&#125;
 &nbsp;else if&#40; _tmp_sOwnerType < 7 && &#40;strlen&#40;_tmp_cName&#41;>0&#41; && &#40;m_iIlusionOwnerH==NULL&#41; && &#40;&#40;m_bIsCrusadeMode == FALSE&#41; || _iGetFOE

&#40;_tmp_iStatus&#41; >= 0&#41;&#41;
 &nbsp;&#123;
 &nbsp; wsprintf&#40; tempid, "/to %s", _tmp_cName &#41;;
 &nbsp; bSendCommand&#40;MSGID_COMMAND_CHATMSG, NULL, NULL, NULL, NULL, NULL, tempid&#41;;
 &nbsp;&#125;
 &nbsp;else
 &nbsp;&#123;
 &nbsp; EndInputString&#40;&#41;;
 &nbsp; wsprintf&#40; m_cChatMsg, "/to " &#41;;
 &nbsp; StartInputString&#40;10, 414, sizeof&#40;m_cChatMsg&#41;, m_cChatMsg&#41;; 
 &nbsp;&#125;
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "spell",5&#41; == 0&#41;&#123;
 char * cTemp;
 cTemp = cConfigHotkeys&#91;wKey&#93;;
 cTemp += 5;
 UseShortCut&#40; atoi&#40;cTemp&#41; &#41;;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "lastspell",9&#41; == 0&#41;&#123;
 if&#40;m_cGameMode != DEF_GAMEMODE_ONMAINGAME&#41; return;
 UseMagic&#40;m_sMagicShortCut&#41;;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "help",4&#41; == 0&#41;&#123;
 if &#40;m_bInputStatus&#41; return;
 if &#40;m_bIsDialogEnabled&#91;35&#93; == FALSE&#41;
 &nbsp;EnableDialogBox&#40;35, NULL, NULL, NULL&#41;;
 else 
 &#123;
 &nbsp;DisableDialogBox&#40;35&#41;;
 &nbsp;DisableDialogBox&#40;18&#41;;
 &#125;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "charinfo",8&#41; == 0&#41;&#123;
 if &#40;m_bIsDialogEnabled&#91;1&#93; == FALSE&#41;
 &nbsp;EnableDialogBox&#40;1, NULL, NULL, NULL&#41;;
 else DisableDialogBox&#40;1&#41;;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "inventory",9&#41; == 0&#41;&#123;
 if &#40;m_bIsDialogEnabled&#91;2&#93; == FALSE&#41;
 &nbsp;EnableDialogBox&#40;2, NULL, NULL, NULL&#41;;
 else DisableDialogBox&#40;2&#41;;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "magiccircle",11&#41; == 0&#41;&#123;
 if &#40;m_bIsDialogEnabled&#91;3&#93; == FALSE&#41;
 &nbsp;EnableDialogBox&#40;3, NULL, NULL, NULL&#41;;
 else DisableDialogBox&#40;3&#41;;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "skillinfo",9&#41; == 0&#41;&#123;
 if &#40;m_bIsDialogEnabled&#91;15&#93; == FALSE&#41;
 &nbsp;EnableDialogBox&#40;15, NULL, NULL, NULL&#41;;
 else DisableDialogBox&#40;15&#41;;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "history",7&#41; == 0&#41;&#123;
 if &#40;m_bIsDialogEnabled&#91;10&#93; == FALSE&#41;
 &nbsp;EnableDialogBox&#40;10, NULL, NULL, NULL&#41;;
 else DisableDialogBox&#40;10&#41;;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "dialogtrans",11&#41; == 0&#41;&#123;
 m_bDialogTrans = !m_bDialogTrans;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "hppotion",8&#41; == 0&#41;&#123;
 if &#40;m_iHP <= 0&#41; return;
 if &#40;m_bItemUsingStatus == TRUE&#41; &#123;
 &nbsp;AddEventList&#40;USE_RED_POTION1, 10&#41;;
 &nbsp;return; 
 &#125;
 if &#40;m_bIsDialogEnabled&#91;27&#93; == TRUE&#41; &#123;
 &nbsp;AddEventList&#40;USE_RED_POTION2, 10&#41;;
 &nbsp;return; 
 &#125;
 for &#40;i = 0; i < DEF_MAXITEMS; i++&#41;
 if &#40; &#40;m_pItemList&#91;i&#93; != NULL&#41; && &#40;m_bIsItemDisabled&#91;i&#93; != TRUE&#41; && 
 &nbsp; &#40;m_pItemList&#91;i&#93;->m_sSprite == 6&#41; && &#40;m_pItemList&#91;i&#93;->m_sSpriteFrame == 1&#41;&#41; &#123;
 &nbsp;
 &nbsp;bSendCommand&#40;MSGID_COMMAND_COMMON, DEF_COMMONTYPE_REQ_USEITEM, NULL, i, NULL, NULL, NULL&#41;; 
 &nbsp; &nbsp; 
 &nbsp;m_bIsItemDisabled&#91;i&#93; = TRUE;
 &nbsp;m_bItemUsingStatus = TRUE;

 &nbsp;return;
 &#125;

 for &#40;i = 0; i < DEF_MAXITEMS; i++&#41;
 if &#40; &#40;m_pItemList&#91;i&#93; != NULL&#41; && &#40;m_bIsItemDisabled&#91;i&#93; != TRUE&#41; && 
 &nbsp; &#40;m_pItemList&#91;i&#93;->m_sSprite == 6&#41; && &#40;m_pItemList&#91;i&#93;->m_sSpriteFrame == 2&#41;&#41; &#123;
 &nbsp;
 &nbsp;bSendCommand&#40;MSGID_COMMAND_COMMON, DEF_COMMONTYPE_REQ_USEITEM, NULL, i, NULL, NULL, NULL&#41;; 
 &nbsp; &nbsp; 
 &nbsp;m_bIsItemDisabled&#91;i&#93; = TRUE;
 &nbsp;m_bItemUsingStatus = TRUE;

 &nbsp;return;
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "mppotion",8&#41; == 0&#41;&#123;
 if &#40;m_iHP <= 0&#41; return;
 if &#40;m_bItemUsingStatus == TRUE&#41; &#123;
 &nbsp;AddEventList&#40;USE_BLUE_POTION1, 10&#41;;
 &nbsp;return; 
 &#125;
 if &#40;m_bIsDialogEnabled&#91;27&#93; == TRUE&#41; &#123;
 &nbsp;AddEventList&#40;USE_BLUE_POTION2, 10&#41;;
 &nbsp;return; 
 &#125;

 for &#40;i = 0; i < DEF_MAXITEMS; i++&#41;
 if &#40; &#40;m_pItemList&#91;i&#93; != NULL&#41; && &#40;m_bIsItemDisabled&#91;i&#93; != TRUE&#41; && 
 &nbsp; &#40;m_pItemList&#91;i&#93;->m_sSprite == 6&#41; && &#40;m_pItemList&#91;i&#93;->m_sSpriteFrame == 3&#41;&#41; &#123;
 &nbsp;
 &nbsp;bSendCommand&#40;MSGID_COMMAND_COMMON, DEF_COMMONTYPE_REQ_USEITEM, NULL, i, NULL, NULL, NULL&#41;; 
 &nbsp; &nbsp; 
 &nbsp;m_bIsItemDisabled&#91;i&#93; = TRUE;
 &nbsp;m_bItemUsingStatus = TRUE;

 &nbsp;return;
 &#125;

 for &#40;i = 0; i < DEF_MAXITEMS; i++&#41;
 if &#40; &#40;m_pItemList&#91;i&#93; != NULL&#41; && &#40;m_bIsItemDisabled&#91;i&#93; != TRUE&#41; && 
 &nbsp; &#40;m_pItemList&#91;i&#93;->m_sSprite == 6&#41; && &#40;m_pItemList&#91;i&#93;->m_sSpriteFrame == 4&#41;&#41; &#123;
 &nbsp;
 &nbsp;bSendCommand&#40;MSGID_COMMAND_COMMON, DEF_COMMONTYPE_REQ_USEITEM, NULL, i, NULL, NULL, NULL&#41;; 
 &nbsp; &nbsp; 
 &nbsp;m_bIsItemDisabled&#91;i&#93; = TRUE;
 &nbsp;m_bItemUsingStatus = TRUE;

 &nbsp;return;
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "lastmsg",7&#41; == 0&#41;&#123;
 if &#40; &#40;&#40;m_bIsDialogEnabled&#91;7&#93; == TRUE&#41; && &#40;m_stDialogBoxInfo&#91;7&#93;.cMode == 1&#41; && &#40;iGetTopDialogBoxIndex&#40;&#41; == 7&#41;&#41; ||
 &nbsp;&#40;&#40;m_bIsDialogEnabled&#91;17&#93; == TRUE&#41; && &#40;m_stDialogBoxInfo&#91;17&#93;.cMode == 1&#41; && &#40;iGetTopDialogBoxIndex&#40;&#41; == 17&#41;&#41; &#41; &#123; 
 &#125;
 else if &#40;&#40;!m_bInputStatus&#41; && &#40;m_cBackupChatMsg&#91;0&#93; != '!'&#41; && &#40;m_cBackupChatMsg&#91;0&#93; != '~'&#41; && &#40;m_cBackupChatMsg&#91;0&#93; != '^'&#41; &&
 &nbsp; &nbsp;&#40;m_cBackupChatMsg&#91;0&#93; != '@'&#41;&#41; &#123;
 &nbsp;ZeroMemory&#40;m_cChatMsg, sizeof&#40;m_cChatMsg&#41;&#41;;
 &nbsp;strcpy&#40;m_cChatMsg, m_cBackupChatMsg&#41;;
 &nbsp;StartInputString&#40;10, 414, sizeof&#40;m_cChatMsg&#41;, m_cChatMsg&#41;; 
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "safeattack",10&#41; == 0&#41;&#123;
 if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME&#41; &#123;
 &nbsp;bSendCommand&#40;MSGID_COMMAND_COMMON, DEF_COMMONTYPE_TOGGLESAFEATTACKMODE, NULL, NULL, NULL, NULL, NULL&#41;; 
 &#125;
 return;
&#125;

if&#40;memcmp&#40; cConfigHotkeys&#91;wKey&#93;, "specialability",14&#41; == 0&#41;&#123;
 if &#40;m_cGameMode != DEF_GAMEMODE_ONMAINGAME&#41; return;
 if &#40;m_bInputStatus&#41; return;
 
 if &#40;m_bIsSpecialAbilityEnabled == TRUE&#41; &#123;
 &nbsp;if &#40;m_iSpecialAbilityType != 0&#41; &#123;
 &nbsp; bSendCommand&#40;MSGID_COMMAND_COMMON, DEF_COMMONTYPE_REQUEST_ACTIVATESPECABLTY, NULL, NULL, NULL, NULL, NULL&#41;;
 &nbsp; m_bIsSpecialAbilityEnabled = FALSE;
 &nbsp;&#125;
 &nbsp;else AddEventList&#40;ON_KEY_UP26, 10&#41;;
 &#125;
 else &#123;
 &nbsp;if &#40;m_iSpecialAbilityType == 0&#41; AddEventList&#40;ON_KEY_UP26, 10&#41;;
 &nbsp;else &#123;
 &nbsp; if &#40;&#40;m_sPlayerAppr4 & 0x00F0&#41; != 0&#41; &#123;
 &nbsp; &nbsp;AddEventList&#40;ON_KEY_UP28, 10&#41;;
 &nbsp; &nbsp;return;
 &nbsp; &#125;

 &nbsp; i = &#40;dwTime - m_dwSpecialAbilitySettingTime&#41;/1000;
 &nbsp; i = m_iSpecialAbilityTimeLeftSec - i;
 &nbsp; if &#40;i < 0&#41; i = 0;
 &nbsp; &nbsp; &nbsp; &nbsp; 
 &nbsp; ZeroMemory&#40;G_cTxt, sizeof&#40;G_cTxt&#41;&#41;;
 &nbsp; if &#40;i < 60&#41; &#123;
 &nbsp; &nbsp;switch &#40;m_iSpecialAbilityType&#41; &#123;
 &nbsp; &nbsp;case 1&#58; wsprintf&#40;G_cTxt, ON_KEY_UP29, i&#41;; break;
 &nbsp; &nbsp;case 2&#58; wsprintf&#40;G_cTxt, ON_KEY_UP30, i&#41;; break;
 &nbsp; &nbsp;case 3&#58; wsprintf&#40;G_cTxt, ON_KEY_UP31, i&#41;; break;
 &nbsp; &nbsp;case 4&#58; wsprintf&#40;G_cTxt, ON_KEY_UP32, i&#41;; break;
 &nbsp; &nbsp;case 5&#58; wsprintf&#40;G_cTxt, ON_KEY_UP33, i&#41;; break;
 &nbsp; &nbsp;case 50&#58;wsprintf&#40;G_cTxt, ON_KEY_UP34, i&#41;; break;
 &nbsp; &nbsp;case 51&#58;wsprintf&#40;G_cTxt, ON_KEY_UP35, i&#41;; break;
 &nbsp; &nbsp;case 52&#58;wsprintf&#40;G_cTxt, ON_KEY_UP36, i&#41;; break;
 &nbsp; &nbsp;&#125;
 &nbsp; &#125;
 &nbsp; else &#123;
 &nbsp; &nbsp;switch &#40;m_iSpecialAbilityType&#41; &#123;
 &nbsp; &nbsp;case 1&#58; wsprintf&#40;G_cTxt, ON_KEY_UP37, i/60&#41;; break;
 &nbsp; &nbsp;case 2&#58; wsprintf&#40;G_cTxt, ON_KEY_UP38, i/60&#41;; break;
 &nbsp; &nbsp;case 3&#58; wsprintf&#40;G_cTxt, ON_KEY_UP39, i/60&#41;; break;
 &nbsp; &nbsp;case 4&#58; wsprintf&#40;G_cTxt, ON_KEY_UP40, i/60&#41;; break;
 &nbsp; &nbsp;case 5&#58; wsprintf&#40;G_cTxt, ON_KEY_UP41, i/60&#41;; break;
 &nbsp; &nbsp;case 50&#58;wsprintf&#40;G_cTxt, ON_KEY_UP42, i/60&#41;; break;
 &nbsp; &nbsp;case 51&#58;wsprintf&#40;G_cTxt, ON_KEY_UP43, i/60&#41;; break;
 &nbsp; &nbsp;case 52&#58;wsprintf&#40;G_cTxt, ON_KEY_UP44, i/60&#41;; break;
 &nbsp; &nbsp;&#125;
 &nbsp; &#125;
 &nbsp; AddEventList&#40;G_cTxt, 10&#41;;
 &nbsp;&#125;
 &#125;
 return;
&#125;
&#125;
Not sure if I modified OnKeyUp:

Code: Select all

void CGame&#58;&#58;OnKeyUp&#40;WPARAM wParam&#41;
&#123;
switch &#40;wParam&#41; &#123;
case VK_SHIFT&#58;
 m_bShiftPressed = FALSE;
 break;
case VK_CONTROL&#58;
 m_bCtrlPressed = FALSE;
 break;

case 107&#58; //'+'
 if&#40;m_bInputStatus == FALSE&#41; m_bZoomMap = TRUE;
 break;

case 109&#58; //'-'
 if&#40;m_bInputStatus == FALSE&#41; m_bZoomMap = FALSE;
 break;

case VK_F12&#58;
 m_bEscPressed = TRUE;
 if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME&#41;
 &#123;
 &nbsp;if &#40;&#40;m_bIsObserverMode == TRUE&#41; && &#40;m_bShiftPressed&#41;&#41; &#123; //ObserverMode Shift+ F12 &#40; not SHIFT+ESC &#41;
 &nbsp; // Log Out
 &nbsp; if &#40;m_cLogOutCount == -1&#41; m_cLogOutCount = 1;
 &nbsp; DisableDialogBox&#40;19&#41;;
 &nbsp; PlaySound&#40;'E', 14, 5&#41;;
 &nbsp;&#125;
 &nbsp;else if&#40;m_cLogOutCount != -1&#41; &#123;
 &nbsp; if &#40;m_bForceDisconn == FALSE&#41; &#123; //Esc
 &nbsp; &nbsp;m_cLogOutCount = -1;
 &nbsp; &nbsp;AddEventList&#40;DLGBOX_CLICK_SYSMENU2, 10&#41;;
 &nbsp; &#125;
 &nbsp;&#125;
 &nbsp;if &#40;m_bIsGetPointingMode == TRUE&#41; &#123;
 &nbsp; m_bIsGetPointingMode = FALSE;
 &nbsp; AddEventList&#40;COMMAND_PROCESSOR1, 10&#41;;
 &nbsp;&#125;
 &nbsp;m_bIsF1HelpWindowEnabled = FALSE;
 &#125;
 break;

case VK_ESCAPE&#58;
 if&#40;m_bInputStatus&#41; return;
 if &#40;m_bIsDialogEnabled&#91;19&#93; == FALSE&#41;
 &nbsp;EnableDialogBox&#40;19, NULL, NULL, NULL&#41;;
 else DisableDialogBox&#40;19&#41;;
 break;

case VK_UP&#58; 
 m_cArrowPressed = 1;
 if&#40; m_cGameMode == DEF_GAMEMODE_ONMAINGAME &#41;
 &#123;
 &nbsp;int iTotalMsg=0;
 &nbsp;for&#40; int i=DEF_MAXWHISPERMSG-1; i>=0; i-- &#41;
 &nbsp;&#123;
 &nbsp; if&#40; m_pWhisperMsg&#91;i&#93; != NULL &#41;
 &nbsp; &#123;
 &nbsp; &nbsp;iTotalMsg = i;
 &nbsp; &nbsp;break;
 &nbsp; &#125;
 &nbsp;&#125;
 &nbsp;m_cWhisperIndex ++;
 &nbsp;if&#40; m_cWhisperIndex > iTotalMsg &#41; m_cWhisperIndex = 0;
 &nbsp;if&#40; m_cWhisperIndex < 0 &#41; m_cWhisperIndex = iTotalMsg;
 &nbsp;if&#40; m_pWhisperMsg&#91;m_cWhisperIndex&#93; != NULL &#41; &#123;
 &nbsp;EndInputString&#40;&#41;;
 &nbsp;wsprintf&#40; m_cChatMsg, "/to %s", m_pWhisperMsg&#91;m_cWhisperIndex&#93;->m_pMsg &#41;;
 &nbsp;StartInputString&#40;10, 414, sizeof&#40;m_cChatMsg&#41;, m_cChatMsg&#41;; 
 &nbsp;&#125;
 &#125;
 break;

case VK_RIGHT&#58; 
 m_cArrowPressed = 2;
 break;

case VK_DOWN&#58; 
 m_cArrowPressed = 3;
 if&#40; m_cGameMode == DEF_GAMEMODE_ONMAINGAME &#41;
 &#123;
 &nbsp;int iTotalMsg=0;
 &nbsp;for&#40; int i=DEF_MAXWHISPERMSG-1; i>=0; i-- &#41;
 &nbsp;&#123;
 &nbsp; if&#40; m_pWhisperMsg&#91;i&#93; != NULL &#41;
 &nbsp; &#123;
 &nbsp; &nbsp;iTotalMsg = i;
 &nbsp; &nbsp;break;
 &nbsp; &#125;
 &nbsp;&#125;
 &nbsp;m_cWhisperIndex --;
 &nbsp;if&#40; m_cWhisperIndex < 0 &#41; m_cWhisperIndex = iTotalMsg;
 &nbsp;if&#40; m_cWhisperIndex > iTotalMsg &#41; m_cWhisperIndex = 0;
 &nbsp;if&#40; m_pWhisperMsg&#91;m_cWhisperIndex&#93; != NULL &#41; &#123;
 &nbsp;EndInputString&#40;&#41;;
 &nbsp;wsprintf&#40; m_cChatMsg, "/to %s", m_pWhisperMsg&#91;m_cWhisperIndex&#93;->m_pMsg &#41;;
 &nbsp;StartInputString&#40;10, 414, sizeof&#40;m_cChatMsg&#41;, m_cChatMsg&#41;; 
 &nbsp;&#125;
 &#125;
 break;

case VK_LEFT&#58; 
 m_cArrowPressed = 4;
 break;

case VK_SNAPSHOT&#58;
 CreateScreenShot&#40;&#41;;
 break;

case VK_TAB&#58;
 if&#40; m_bShiftPressed &#41;
 &#123;
 &nbsp;m_cCurFocus--;
 &nbsp;if&#40; m_cCurFocus < 1 &#41; m_cCurFocus = m_cMaxFocus;
 &#125;
 else
 &#123;
 &nbsp;m_cCurFocus++;
 &nbsp;if&#40; m_cCurFocus > m_cMaxFocus&#41; m_cCurFocus = 1;
 &#125;
 
 if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME&#41; &#123;
 &nbsp;bSendCommand&#40;MSGID_COMMAND_COMMON, DEF_COMMONTYPE_TOGGLECOMBATMODE, NULL, NULL, NULL, NULL, NULL&#41;; 
 &#125;
 break;

case VK_RETURN&#58;
 m_bEnterPressed = TRUE; 
 break;
&#125;

// Cleroth - CTRL Hotkeys
HandleScript&#40;wParam&#41;;
&#125;

void CGame&#58;&#58;OnKeyDown&#40;WPARAM wParam&#41;
&#123;
	switch &#40;wParam&#41; &#123;
	case VK_CONTROL&#58;
 &nbsp;m_bCtrlPressed = TRUE;
 &nbsp;break;
	case VK_SHIFT&#58;
 &nbsp;m_bShiftPressed = TRUE;
 &nbsp;break;
	case VK_INSERT&#58;
	case VK_DELETE&#58;
	case VK_TAB&#58;
	case VK_RETURN&#58;
	case VK_ESCAPE&#58;
	case VK_END&#58; 
	case VK_HOME&#58;
	case VK_F1&#58;
	case VK_F2&#58;
	case VK_F3&#58;
	case VK_F4&#58;
	case VK_F5&#58;
	case VK_F6&#58;
	case VK_F7&#58;
	case VK_F8&#58;
	case VK_F9&#58;
	case VK_F10&#58;
	case VK_F11&#58;
	case VK_F12&#58;
	case VK_PRIOR&#58; // Page-Up
	case VK_NEXT&#58; // Page-Down
	case VK_LWIN&#58;
	case VK_RWIN&#58; 
	case VK_MULTIPLY&#58;
	case VK_ADD&#58; //'+'
	case VK_SEPARATOR&#58;
	case VK_SUBTRACT&#58; //'-'
	case VK_DECIMAL&#58;
	case VK_DIVIDE&#58;
	case VK_NUMLOCK&#58;
	case VK_SCROLL&#58;
 &nbsp;break;

	default&#58;
 &nbsp;if &#40;m_cGameMode == DEF_GAMEMODE_ONMAINGAME&#41; &#123;
 &nbsp;	if &#40;m_bCtrlPressed&#41; &#123;
 &nbsp; &nbsp;switch &#40;wParam&#41; &#123;
 &nbsp; &nbsp;case 48&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 9; break; // 0
 &nbsp; &nbsp;case 49&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 0; break; // 1
 &nbsp; &nbsp;case 50&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 1; break; // 2 
 &nbsp; &nbsp;case 51&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 2; break; // 3
 &nbsp; &nbsp;case 52&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 3; break; // 4 
 &nbsp; &nbsp;case 53&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 4; break; // 5
 &nbsp; &nbsp;case 54&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 5; break; // 6
 &nbsp; &nbsp;case 55&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 6; break; // 7
 &nbsp; &nbsp;case 56&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 7; break; // 8
 &nbsp; &nbsp;case 57&#58; EnableDialogBox&#40;3, NULL, NULL, NULL&#41;; m_stDialogBoxInfo&#91;3&#93;.sView = 8; break; // 9
 &nbsp; &nbsp;&#125;
 &nbsp;	&#125;
 &nbsp;	else if &#40;&#40;m_bInputStatus == FALSE&#41; && &#40;GetAsyncKeyState&#40;VK_MENU&#41;>>15 == FALSE&#41;&#41; &#123;
 &nbsp; &nbsp;StartInputString&#40;10, 414, sizeof&#40;m_cChatMsg&#41;, m_cChatMsg&#41;; 
 &nbsp; &nbsp;ClearInputString&#40;&#41;;
 &nbsp;	&#125;
 &nbsp;&#125;
 &nbsp;break;
	&#125;
&#125;
Add:

Code: Select all

void CGame&#58;&#58;UpdateScreen_OnLoading&#40;bool bActive&#41;
&#123; 
	int i;
	if&#40; bActive &#41; UpdateScreen_OnLoading_Progress&#40;&#41;;

	switch&#40; m_cLoading &#41;
	&#123;
	case 0&#58;
 &nbsp;&#123;
 &nbsp;	ZeroMemory&#40;cIni, sizeof&#40;cIni&#41; &#41;;
 &nbsp;	ZeroMemory&#40;cConfigHotkeys, sizeof&#40;cConfigHotkeys&#41; &#41;;
 &nbsp;	GetCurrentDirectory&#40;1000, cIni&#41;;
 &nbsp;	strcat&#40;cIni,"&#092;&#092;config.ini"&#41;;
 &nbsp;	LoadHotkeys&#40;cIni&#41;;
In Game.h:

Code: Select all

	char cConfigHotkeys&#91;140&#93;&#91;50&#93;;
	char cIni&#91;1000&#93;;
	void LoadHotkeys&#40;char * cFile&#41;;
	void HandleScript&#40;WORD wKey&#41;;

Code: Select all

void CGame&#58;&#58;EraseItem&#40;char cItemID&#41;
&#123;
 int i;
 char cStr1&#91;64&#93;, cStr2&#91;64&#93;, cStr3&#91;64&#93;;

 ZeroMemory&#40;cStr1, sizeof&#40;cStr1&#41;&#41;;
 ZeroMemory&#40;cStr2, sizeof&#40;cStr2&#41;&#41;;
 ZeroMemory&#40;cStr3, sizeof&#40;cStr3&#41;&#41;;
	// Cleroth - hotkeys
	for&#40; i=0; i<13; i++ &#41;&#123;
 &nbsp;if &#40;m_sShortCut&#91;i&#93; == cItemID&#41; &#123;
 &nbsp;	GetItemName&#40;m_pItemList&#91;cItemID&#93;, cStr1, cStr2, cStr3&#41;;
 &nbsp;	sprintf&#40;G_cTxt, ERASE_ITEM, cStr1, cStr2, cStr3, i&#41;;
 &nbsp;	AddEventList&#40;G_cTxt, 10&#41;;
 &nbsp;	m_sShortCut&#91;i&#93; = -1;
 &nbsp;&#125;
	&#125;

	if &#40;cItemID == m_sRecentShortCut&#41;
	m_sRecentShortCut = -1;

	for &#40;i = 0; i < DEF_MAXITEMS; i++&#41; 
	if &#40;m_cItemOrder&#91;i&#93; == cItemID&#41; 
	m_cItemOrder&#91;i&#93; = -1;

	for &#40;i = 1; i < DEF_MAXITEMS; i++&#41;
	if &#40;&#40;m_cItemOrder&#91;i-1&#93; == -1&#41; && &#40;m_cItemOrder&#91;i&#93; != -1&#41;&#41; &#123;
 &nbsp;m_cItemOrder&#91;i-1&#93; = m_cItemOrder&#91;i&#93;; 
 &nbsp;m_cItemOrder&#91;i&#93; &nbsp; = -1;
	&#125;

	delete m_pItemList&#91;cItemID&#93;;
	m_pItemList&#91;cItemID&#93; = NULL;
	m_bIsItemEquipped&#91;cItemID&#93; = FALSE;
	m_bIsItemDisabled&#91;cItemID&#93; = FALSE;
&#125;

Create a config.ini file in the Client directory.
For a classic hotkey configuration (for letters, you still have to press CTRL+LETTER):

Code: Select all

&#91;HOTKEYS&#93;
A=autoattack
B=
C=
D=detail
E=
F=
G=
H=
I=
J=
K=
L=
M=map
N=
O=
P=
Q=hppotion
R=walkrun
S=music
T=to
U=
V=
W=
X=
Y=
Z=
F1=help
F2=spell02
F3=spell03
F4=lastspell
F5=charinfo
F6=inventory
F7=magiccircle
F8=skillinfo
F9=history
F10=
F11=dialogtrans
F12=
Insert=hppotion
Delete=mppotion
End=lastmsg
Home=safeattack
PageUp=specialability
PageDown=

For hotkeys with spells on 0-9 and F1-F12 and other modified shits:

Code: Select all

&#91;HOTKEYS&#93;
A=charinfo
B=music
C=detail
D=magiccircle
E=/tp 
F=skillinfo
G=history
H=dialogtrans
I=
J=help
K=
L=
M=
N=to
O=
P=
Q=hppotion
R=/summon 
S=inventory
T=/enableadmincommand 
U=
V=map
W=mppotion
X=walkrun
Y=/enableadmincreateitem 
Z=autoattack
F1=spell01
F2=spell02
F3=spell03
F4=spell04
F5=spell05
F6=spell06
F7=spell07
F8=spell08
F9=spell09
F10=spell10
F11=spell11
F12=spell12
Insert=specialability
Delete=safeattack
End=lastmsg
Home=lastspell
PageUp=
PageDown=
0=spell10
1=spell01
2=spell02
3=spell03
4=spell04
5=spell05
6=spell06
7=spell07
8=spell08
9=spell09
Other than that, you can just create your own, that's what this is for.
<img src='http://ic1.deviantart.com/fs11/i/2006/1 ... leroth.gif' border='0' alt='user posted image' />

Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked » Fri Apr 27, 2007 3:39 pm

Nice idea. :-)
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='http://www.unadvised.net/forums/index.p ... c=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='http://www.unadvised.net/forums/index.p ... 3&hl=x-mas' target='_blank'>My Files</a>

juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 » Sun May 27, 2007 12:57 pm

nice just noticed this gj
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you » Mon May 28, 2007 12:02 am

juggalo2 wrote: nice just noticed this gj
Because no one cares :P :lol:
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.

juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 » Mon May 28, 2007 12:04 am

bone&#045;you wrote:
juggalo2 wrote: nice just noticed this gj
Because no one cares :P :lol:
zero stfu
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you » Mon May 28, 2007 2:59 am

juggalo2 wrote:
bone&#045;you wrote:
juggalo2 wrote: nice just noticed this gj
Because no one cares :P :lol:
zero stfu
It's true >.> if anyone cared it'd have more than 2 posts in it about it... and not just 1 after an entire month.
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.

juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 » Mon May 28, 2007 11:02 am

bone&#045;you wrote:
juggalo2 wrote:
bone&#045;you wrote:
juggalo2 wrote: nice just noticed this gj
Because no one cares :P :lol:
zero stfu
It's true >.> if anyone cared it'd have more than 2 posts in it about it... and not just 1 after an entire month.
yea theres serval post liek this were pll just sue the code thats it.
its the same for when snoopy realsed apoc an shit
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sentinel
Loyal fan
Posts: 462
Joined: Thu Jan 11, 2007 4:16 pm

Post by Sentinel » Tue May 29, 2007 7:59 pm

juggalo2 wrote:
bone&#045;you wrote:
juggalo2 wrote:
bone&#045;you wrote:
juggalo2 wrote: nice just noticed this gj
Because no one cares :P :lol:
zero stfu
It's true >.> if anyone cared it'd have more than 2 posts in it about it... and not just 1 after an entire month.
yea theres serval post liek this were pll just sue the code thats it.
its the same for when snoopy realsed apoc an shit
I agree.
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->charlie says:<br>i may own outpost but im not a nerd<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br><!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->(locobans @ Mar 12 2007, 10:48 PM) <br>"Remember while peeing, If you shake it more than twice you playing with it..." <br><!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd-->

bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you » Wed May 30, 2007 7:05 am

meh. Snoopy's code is as painful to look at as Cleroth trying to code. Not saying Snoopy can't code, but how he types it all out gives me a headache :(
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.

Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax » Wed May 30, 2007 2:40 pm

bone&#045;you wrote: meh. Snoopy's code is as painful to look at as Cleroth trying to code. Not saying Snoopy can't code, but how he types it all out gives me a headache :(
I think this is a great code. The only thing i could pick on it for missing is a client GUI to config the keys. Doesnt feel right players have to script their keys. But apart from that it's fine.

Oh a note to any1 who might use this; 'ESC' isnt setup to exit connection dialogs.
Reppin' 127.0.0.1&#33;&#33;&#33;<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>

Cleroth
Loyal fan
Posts: 416
Joined: Wed Jun 16, 2004 7:08 pm

Post by Cleroth » Sun Jun 03, 2007 2:44 am

bone&#045;you wrote: meh. Snoopy's code is as painful to look at as Cleroth trying to code. Not saying Snoopy can't code, but how he types it all out gives me a headache :(
It's not really my code. It's Siementech's programmers code modified by Cleroth.
And as in modified I don't mean optimized.
<img src='http://ic1.deviantart.com/fs11/i/2006/1 ... leroth.gif' border='0' alt='user posted image' />


Post Reply