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
Threaded Mode
Release Public Chat AI
28-12-2013, 02:08 PM,
#1
Knight Offline
Valued donator and member
****
Posts: 397
Threads: 21
Joined: Nov 2013
Public Chat AI
Here's a Public Chat AI i created for a Friend also it only works on TSCM servers.

Code:

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

Wiring up:

[Shield] Activate > Shield
[Cloak] Activate > Cloak
[SBEP Door] Lock_1 > Lock [As many as you want for doors]
[SBEP Door] Open > Door [ As Many as you want ]

Any questions?
Feel free to contact me on the server or over steam




Find
Reply
29-12-2013, 11:39 PM,
#2
Packge Offline
Valued donator and member
****
Posts: 8
Threads: 3
Joined: Nov 2013
RE: Public Chat AI
Gj nice and sample Smile
Find
Reply
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
31-12-2013, 10:43 AM,
#4
Knight Offline
Valued donator and member
****
Posts: 397
Threads: 21
Joined: Nov 2013
RE: Public Chat AI
Thank you for that ille try and use that when i can and will still improve this E2. Also Person can yo do me 2 favors 1. Change my Forum name to <ITG>Firestorm and give me forum member group. thanx also its my Birthday




Find
Reply
02-01-2014, 09:06 AM,
#5
bovb902 Offline
a Person apparently.
***
Posts: 23
Threads: 5
Joined: Oct 2013
RE: Public Chat AI
Putting this to good use. I am also modifying it for some Selfdestruct functions and armor deployation so far so good
Find
Reply
08-01-2014, 02:11 PM,
#6
bovb902 Offline
a Person apparently.
***
Posts: 23
Threads: 5
Joined: Oct 2013
RE: Public Chat AI
Can i use this as an Faction Controlled something? i would like that script command for it please. my faction wants access to my ship fully
Find
Reply
24-09-2014, 08:42 AM,
#7
Knight Offline
Valued donator and member
****
Posts: 397
Threads: 21
Joined: Nov 2013
RE: Public Chat AI
Sure.




Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


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

Powered By MyBB, © 2002-2026 MyBB Group.