Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Expression 2 v
« Previous 1 … 4 5 6 7 8 Next »
Release Public Chat AI
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
Release Public Chat AI
30-12-2013, 03:35 PM,
#3
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Public Chat AI
Have you not considered how to condense it at all?

Rather than doing loads of the same copy-paste code with a bit changed, you can condense it into one large statement. Also, you misunderstand what @persist means. @persist is for variables you want to store between executions, it has nothing to do with inputs or outputs.

Code:
@name Public AI @outputs Shield Cloak Door Lock @persist Owner Chip runOnChat(1) if(first()) { botSay("TSCM", "Public", vec(203,65,84) , "Hal9000 Up and Running, Hello Burn") Owner = owner() Chip = entity() } elseif(chatClk(Owner)) { LastSaid = Owner:lastSaid() if(LastSaid=="Hal9000 who am i?") { botSay("TSCM", "Public", vec(203,65,84) , "Your Burn, Are you stupid?") } elseif(LastSaid == "Hal9000?") { botSay("TSCM", "Public", vec(203,65,84) , "Yes Sir how may i help you?") } elseif(LastSaid == "Hal9000 raise shield") { botSay("TSCM", "Public", vec(203,65,84) , "Raising Shield Now , Sir!") Shield = 1 } elseif(LastSaid == "Hal9000 lower shield") { botSay("TSCM", "Public", vec(203,65,84) , "Lowering Shield Now , Sir!") Shield = 0 } elseif(LastSaid == "Hal9000 enable cloak") { botSay("TSCM", "Public", vec(203,65,84) , "Cloaking Enabled, Sir!") Cloak = 1 } elseif(LastSaid == "Hal9000 disable cloak") { botSay("TSCM", "Public", vec(203,65,84) , "Cloaking Disabled, Sir!") Cloak = 0 } elseif(LastSaid == "Hal9000 open doors") { botSay("TSCM", "Public", vec(203,65,84) , "Opening All Doors, Sir!") Door = 1 } elseif(LastSaid == "Hal9000 close doors") { botSay("TSCM", "Public", vec(203,65,84) , "Closing All Doors, Sir!") Door = 0 } elseif(LastSaid == "Hal9000 enable lockdown") { botSay("TSCM", "Public", vec(203,65,84) , "Lockdown enabled RED ALERT!!! LOCKING DOWN, Sir!") Lock = 1 } elseif(LastSaid == "Hal9000 disable lockdown") { botSay("TSCM", "Public", vec(203,65,84) , "Lockdown Disabled, Sir!") Lock = 0 } }

There's still more that can be done to it to improve it, such as making it case insensitive, delaying the response so it appears after what you say and avoiding copy-pasting the same botSay() line every time you want it to speak.

I'll leave you to figure out how to do that.
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Public Chat AI - by Knight - 28-12-2013, 02:08 PM
RE: Public Chat AI - by Packge - 29-12-2013, 11:39 PM
RE: Public Chat AI - by Person8880 - 30-12-2013, 03:35 PM
RE: Public Chat AI - by Knight - 31-12-2013, 10:43 AM
RE: Public Chat AI - by bovb902 - 02-01-2014, 09:06 AM
RE: Public Chat AI - by bovb902 - 08-01-2014, 02:11 PM
RE: Public Chat AI - by Knight - 24-09-2014, 08:42 AM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.