Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Tutorials
[R26][HOLO] Customisable Commands [TUT]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Benson" data-source="post: 28996" data-attributes="member: 1457"><p>Heeeellooooo!</p><p></p><p>Well, this tutorial has never been written or released before, but I earlier on I was having fun around on an R63 phoenix server, I found some new commands such as "o/", as I don't do the new flash servers, I stick to shockwave, I found a way to make these commandments work on an R26.</p><p></p><p>All you need is a few simple edits in virtualUser.cs, make sure you keep a backup, though - just incase you make a mistake!</p><p></p><p>---------------------------------------</p><p>What you need:</p><p>- <strong>Holograph Emulator R26</strong> - <em>example: TDbP, Handyandy160's edit, Dissi's edit.</em></p><p>- A <strong>brain</strong> and <strong>common sense</strong></p><p>---------------------------------------</p><p></p><p>1. Open up <strong>virtualUser.cs</strong> in Microsoft Visual C# 2008 / 2010.</p><p>2. Find the <strong>string</strong>:</p><p>[CODE]case "@w":[/CODE]</p><p>3. You should've found <strong>something almost like this</strong>, or exactly in some cases.</p><p>[CODE]</p><p> case "@w": // Chat - shout</p><p> {</p><p> try</p><p> {</p><p> if (_isMuted == false && (Room != null && roomUser != null))</p><p> {</p><p> string Message = currentPacket.Substring(4);</p><p> userManager.addChatMessage(_Username, _roomID, Message);</p><p> Message = stringManager.filterSwearwords(Message);</p><p> if (Message.Substring(0, 1) == ":" && isSpeechCommand(Message.Substring(1))) // Speechcommand invoked!</p><p> {</p><p> if (roomUser.isTyping)</p><p> {</p><p> Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H");</p><p> roomUser.isTyping = false;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> if (currentPacket.Substring(1, 1) == "w") // Shout</p><p> {</p><p> Room.sendShout(roomUser, Message);</p><p> }</p><p> else</p><p> {</p><p> Room.sendSaying(roomUser, Message);</p><p> //Out.WriteChat("Say", _Username, Message); </p><p> }</p><p> }</p><p> }</p><p> }</p><p> catch (Exception e)</p><p> {</p><p> Out.WriteError(e.ToString());</p><p> }</p><p> break;</p><p> }</p><p>[/CODE]</p><p></p><p>4. Search for this <strong>start of a function</strong>:</p><p>[CODE]</p><p>private bool isSpeechCommand</p><p>[/CODE]</p><p></p><p>5. Above the found string 'private bool isSpeechCommand', <strong>add the below code snippet</strong>.</p><p>[CODE]</p><p>private bool isCustomCommand(string Text)</p><p>{</p><p> switch (Text.ToLower()) {</p><p> case "o/":</p><p> Out.WriteLine(_Username + " has sent a special action command 'wave'");</p><p> if (Room != null && roomUser != null && statusManager.containsStatus("wave") == false)</p><p> {</p><p> statusManager.removeStatus("dance");</p><p> statusManager.handleStatus("wave", "", Config.Statuses_Wave_waveDuration);</p><p> }</p><p> break;</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>6. Now that we have the custom command function implemented, we need to make it so we can pick it up with the chat case.</p><p></p><p>7. Find the <strong>string</strong> (<em>yes, again</em>)</p><p>[CODE]</p><p>case "@w":</p><p>[/CODE]</p><p></p><p>8. Add this to it <em>(read next step to see where it goes)</em>:</p><p>[CODE]</p><p> }else if (isCustomCommand(Message))</p><p> {</p><p> if (roomUser.isTyping)</p><p> {</p><p> Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H");</p><p> roomUser.isTyping = false;</p><p> }</p><p> }</p><p>[/CODE]</p><p></p><p>9. The code under <strong>'case "@w":'</strong> should now <strong>look like this</strong>:</p><p>[CODE]</p><p> case "@w": // Chat - shout</p><p> {</p><p> try</p><p> {</p><p> if (_isMuted == false && (Room != null && roomUser != null))</p><p> {</p><p> string Message = currentPacket.Substring(4);</p><p> userManager.addChatMessage(_Username, _roomID, Message);</p><p> Message = stringManager.filterSwearwords(Message);</p><p> if (Message.Substring(0, 1) == ":" && isSpeechCommand(Message.Substring(1))) // Speechcommand invoked!</p><p> {</p><p> if (roomUser.isTyping)</p><p> {</p><p> Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H");</p><p> roomUser.isTyping = false;</p><p> }</p><p> }else if (isCustomCommand(Message))</p><p> {</p><p> if (roomUser.isTyping)</p><p> {</p><p> Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H");</p><p> roomUser.isTyping = false;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> if (currentPacket.Substring(1, 1) == "w") // Shout</p><p> {</p><p> Room.sendShout(roomUser, Message);</p><p> }</p><p> else</p><p> {</p><p> Room.sendSaying(roomUser, Message);</p><p> //Out.WriteChat("Say", _Username, Message); </p><p> }</p><p> }</p><p> }</p><p> }</p><p> catch (Exception e)</p><p> {</p><p> Out.WriteError(e.ToString());</p><p> }</p><p> break;</p><p> }</p><p>[/CODE]</p><p></p><p>10. <span style="color: #ff8c00">Debug</span> and <span style="color: lime">run</span>!</p><p>----------------------------</p><p><strong>100% credits to me (<u>Benson</u>)</strong></p><p>If you wish to spread this, please do so, but please give me fullcredit!</p><p></p><p>If you encounter any problems or errors, please reply the error and a screenshot.</p><p>Thanks for reading, please thank me if i've helped, or this is a good tutorial <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Benson, post: 28996, member: 1457"] Heeeellooooo! Well, this tutorial has never been written or released before, but I earlier on I was having fun around on an R63 phoenix server, I found some new commands such as "o/", as I don't do the new flash servers, I stick to shockwave, I found a way to make these commandments work on an R26. All you need is a few simple edits in virtualUser.cs, make sure you keep a backup, though - just incase you make a mistake! --------------------------------------- What you need: - [B]Holograph Emulator R26[/B] - [I]example: TDbP, Handyandy160's edit, Dissi's edit.[/I] - A [B]brain[/B] and [B]common sense[/B] --------------------------------------- 1. Open up [B]virtualUser.cs[/B] in Microsoft Visual C# 2008 / 2010. 2. Find the [B]string[/B]: [CODE]case "@w":[/CODE] 3. You should've found [B]something almost like this[/B], or exactly in some cases. [CODE] case "@w": // Chat - shout { try { if (_isMuted == false && (Room != null && roomUser != null)) { string Message = currentPacket.Substring(4); userManager.addChatMessage(_Username, _roomID, Message); Message = stringManager.filterSwearwords(Message); if (Message.Substring(0, 1) == ":" && isSpeechCommand(Message.Substring(1))) // Speechcommand invoked! { if (roomUser.isTyping) { Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H"); roomUser.isTyping = false; } } else { if (currentPacket.Substring(1, 1) == "w") // Shout { Room.sendShout(roomUser, Message); } else { Room.sendSaying(roomUser, Message); //Out.WriteChat("Say", _Username, Message); } } } } catch (Exception e) { Out.WriteError(e.ToString()); } break; } [/CODE] 4. Search for this [B]start of a function[/B]: [CODE] private bool isSpeechCommand [/CODE] 5. Above the found string 'private bool isSpeechCommand', [B]add the below code snippet[/B]. [CODE] private bool isCustomCommand(string Text) { switch (Text.ToLower()) { case "o/": Out.WriteLine(_Username + " has sent a special action command 'wave'"); if (Room != null && roomUser != null && statusManager.containsStatus("wave") == false) { statusManager.removeStatus("dance"); statusManager.handleStatus("wave", "", Config.Statuses_Wave_waveDuration); } break; } } [/CODE] 6. Now that we have the custom command function implemented, we need to make it so we can pick it up with the chat case. 7. Find the [B]string[/B] ([I]yes, again[/I]) [CODE] case "@w": [/CODE] 8. Add this to it [I](read next step to see where it goes)[/I]: [CODE] }else if (isCustomCommand(Message)) { if (roomUser.isTyping) { Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H"); roomUser.isTyping = false; } } [/CODE] 9. The code under [B]'case "@w":'[/B] should now [B]look like this[/B]: [CODE] case "@w": // Chat - shout { try { if (_isMuted == false && (Room != null && roomUser != null)) { string Message = currentPacket.Substring(4); userManager.addChatMessage(_Username, _roomID, Message); Message = stringManager.filterSwearwords(Message); if (Message.Substring(0, 1) == ":" && isSpeechCommand(Message.Substring(1))) // Speechcommand invoked! { if (roomUser.isTyping) { Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H"); roomUser.isTyping = false; } }else if (isCustomCommand(Message)) { if (roomUser.isTyping) { Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H"); roomUser.isTyping = false; } } else { if (currentPacket.Substring(1, 1) == "w") // Shout { Room.sendShout(roomUser, Message); } else { Room.sendSaying(roomUser, Message); //Out.WriteChat("Say", _Username, Message); } } } } catch (Exception e) { Out.WriteError(e.ToString()); } break; } [/CODE] 10. [COLOR="#ff8c00"]Debug[/COLOR] and [COLOR="lime"]run[/COLOR]! ---------------------------- [B]100% credits to me ([U]Benson[/U])[/B] If you wish to spread this, please do so, but please give me fullcredit! If you encounter any problems or errors, please reply the error and a screenshot. Thanks for reading, please thank me if i've helped, or this is a good tutorial :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
[R26][HOLO] Customisable Commands [TUT]
Top