[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  user response (Y/N) OnPluginEnable
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

user response (Y/N) OnPluginEnable

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Lua_Newbie_Lunk   (3 posts)  [Biography] bio
Date Sun 16 Apr 2017 02:21 AM (UTC)
Message
so, I have a attack spell manager, I would like it to determine if a player plays a melee class or spell-casting class so that the aliases within the plugin can be set and exectued accordingly with the same syntax... I can make the latter part happen what I need to know is how can I change this...


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, March 18, 2017, 6:07 AM -->
<!-- MuClient version 4.98 -->

<!-- Plugin "Attack_Spell_Manager" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Attack_Spell_Manager"
   author="Lunk"
   id="11e0de8bfe76c4700438e897"
   language="Lua"
   purpose="manages attack spell"
   save_state="y"
   date_written="2017-03-18 06:04:52"
   requires="4.98"
   version="1.0"
   >
<description trim="y">
<![CDATA[
as help  --->  displays this help
as *     --->  sets attack spell to *
as       --->  displays attack spell
cs *     --->  casts attack spell on mob *
cs       --->  casts attack spell
]]>
</description>

</plugin>


<!--  Get our standard constants -->

<include name="constants.lua"/>

<!--  Aliases  -->

<aliases>
  <alias
   match="as"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>ColourNote ("red", "blue", "Attack Spell : @attack_spell")</send>
  </alias>
  <alias
   match="as *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable ("attack_spell", "%1")
ColourNote ("red", "blue", "Attack Spell set to : %1")</send>
  </alias>
  <alias
   match="cs"
   enabled="y"
   expand_variables="y"
   sequence="100"
  >
  <send>c '@attack_spell'</send>
  </alias>
  <alias
   match="cs *"
   enabled="y"
   expand_variables="y"
   sequence="100"
  >
  <send>c '@attack_spell' %1</send>
  </alias>
</aliases>

<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="as help"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
function OnHelp ()
  world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script> 

</muclient>



with additional code as a simple question and y/n response with the addition within a simple function OnPluginEnable ? is there a way to ask a user for a response client side within a plugin? That's the key here...
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Sun 16 Apr 2017 09:57 AM (UTC)

Amended on Sun 16 Apr 2017 09:58 AM (UTC) by Fiendish

Message
Well, you could use utils.msgbox ( https://www.gammon.com.au/scripts/doc.php?general=lua_utils )

But if you're talking about Aardwolf you should read char.base.class from gmcp so that you don't have to throw a message box in front of the user all the time.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,002 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]