HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Calling Chat and Console Commands from script  (Read 1560 times)

lileebeta

  • General Accounts
  • *
  • Posts: 48
    • View Profile

Is it possible to call Chat commands and or Consol commands directly from inside of a script?
For example ,if I have a trigger glomed with a script that called a Chat or consol command such as /HEGO or /DN. - Is is possible to call them from within a script? iI so How so.
« Last Edit: Nov 01, 12, 10:15:52 AM by HE-Cooper »
Logged

GM_James

  • General Accounts
  • *
  • Posts: 118
    • View Profile
Re: Command Calls
« Reply #1 on: Oct 15, 11, 10:33:26 AM »

Yes it is possible...

Using the Chat prototype you can call I believe $CHAT._ProcessChatInput("Command")

for Console commands I'm not sure how you would go about doing that.

here is my Group GUI Script for handling Accepting and Rejecting Group Invites:

Code: [Select]
shared function onButtonClick( button as NodeRef of Class _GUIButton, args references Class GUIMouseEvent )
 
  println("OnButtonClick: " + button.name)
 
  args.handled = true
  when button.name
    is "Accept"
      $Chat._ProcessChatInput("/accept")
      close()
    .
    is "Reject"
      $Chat._ProcessChatInput("/reject")
      close()
    .
    default
     
    .
  .
.
« Last Edit: Oct 15, 11, 10:38:32 AM by James »
Logged

lileebeta

  • General Accounts
  • *
  • Posts: 48
    • View Profile
Re: Command Calls
« Reply #2 on: Oct 15, 11, 11:47:23 AM »

Thank you, I will experiment with it- and it looks promising.
 :D
Logged

JMurdick

  • General Accounts
  • *
  • Posts: 54
    • View Profile
Re: Command Calls
« Reply #3 on: Oct 15, 11, 01:02:32 PM »

Yes, it is possible.  The mob spawn system in HJRef does this.
Logged