Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
Mr.Easybb (1587)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
Bloodbath (745)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
Rukiafan (533)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
Dom (513)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
puppycheese (446)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
pedro (330)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
Neymar (301)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
Hitsu (281)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 
Flora (275)
Query on Actions... Vote_lcapQuery on Actions... Voting_barQuery on Actions... Vote_rcap 


Query on Actions...

avatarLlewoj
Status : No status yet...

Posts : 21
Join date : 2015-02-16
Tue 31 Mar 2015, 05:14
Hi, so I'm a little slow in figuring things out here... Is there a command I can input to make random actions/slaps? For example, if some one type in "/slap <name>" an action will come out with "<you> slap <name> around with a big pillow." Of course it will randomly replace the item with a different item every time.

I really am an ignoramus when it comes to coding and stuff, so thank you in advance for your patience and assistance.
BloodbathBloodbath
Status : No status yet...

Posts : 745
Join date : 2013-05-31
Age : 28
Tue 31 Mar 2015, 06:15
Check out the documentation for this here: http://chat.avacweb.net/addcommands

The command would look roughly like this:

Code:
commands: {
 slap: {
  run: function(text) {
  return "/me slaps " + text + " with a wet trout.";
  },
  staff: false
 }
}

I'll let you try to figure out how to add random objects to slap the user with, but here's a hint: use an array and Math.random()
avatarLlewoj
Status : No status yet...

Posts : 21
Join date : 2015-02-16
Tue 31 Mar 2015, 06:32
Thanks for your help, will try and fiddle with it...

Oh yeah, the command though is seen in the regular forumotion chatbox but doesn't come out in the awc chatbox.
BloodbathBloodbath
Status : No status yet...

Posts : 745
Join date : 2013-05-31
Age : 28
Tue 31 Mar 2015, 06:43
What happens if you enter just "/me test" through the AWC?
avatarLlewoj
Status : No status yet...

Posts : 21
Join date : 2015-02-16
Tue 31 Mar 2015, 06:57
It comes out as an action.

"*Llewoj test"
BloodbathBloodbath
Status : No status yet...

Posts : 745
Join date : 2013-05-31
Age : 28
Tue 31 Mar 2015, 07:21
Give me a few more minutes to work out something for you.
LGforumLGforum
Status : Working to restore AWC!

Posts : 2806
Join date : 2011-10-05
Age : 30
Location : UK
Tue 31 Mar 2015, 07:46
Maybe there is a bug in commands as mentioned in the big thread.
BloodbathBloodbath
Status : No status yet...

Posts : 745
Join date : 2013-05-31
Age : 28
Tue 31 Mar 2015, 09:17
For now adding this will work:

Code:
[panda=js]commands: {
  slap: {
    run: function(text) {
      var objectArray = ["a wet trout", "a shoe", "a groggy grain of sand", "an incended stick", "a lethal dose of sauce"];
      return (avacweb_chat.submit("/me slaps " + text + " with " + objectArray[Math.floor(Math.random() * objectArray.length)]), false);
    },
    staff: false,
    description: "Slap someone. You know you want to. /slap <user>"
  }
}

Edit: Interestingly enough, I know what the issue is now...
avatarLlewoj
Status : No status yet...

Posts : 21
Join date : 2015-02-16
Tue 31 Mar 2015, 10:36
Thank you. Very Happy It now works. Very Happy
Sponsored content