[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]  General
. . -> [Subject]  Weird issue where the plugin changes get undone
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Weird issue where the plugin changes get undone

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


Posted by Glorimus   (7 posts)  [Biography] bio
Date Thu 13 Oct 2016 07:45 PM (UTC)
Message
I wrote a simple plugin to change characters. It looks like for brief moment, my settings take, but as soon as I connect all the changes are undone.


for example im setting the chat title,and the username,password. none of these are being used


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
    <plugin
    name="changechar"
    author="glorimus"
    id="726f33a0121c752b023e4371"
    language="Lua"
    purpose="changechar"
    requires="4.52"
    version="2.4"
    save_state="y"
    >
<description trim="y">
USAGE:
    Test
      
</description>
  
</plugin>
<aliases>
 <alias
   match="^(goappa)(\s.+)?$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
Execute("zzap")
local charname = "my_new_char"
SetTitle(charname)
SetAlphaOption("name",charname)
SetAlphaOption("player",charname)
SetAlphaOption("password","xxx")
Connect()</send>
</alias>
</aliases>
<script>
<![CDATA[
]]>
</script>
</muclient>
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 13 Oct 2016 08:03 PM (UTC)
Message
Your alias has a capture (wildcard) which you don't seem to be using.

The chat name is option "chat_name" which you are not using.




The alpha options name, player and password are not allowed to be changed by plugins as a security measure (for example, brute-force attempting to connect as different characters).

If you check the return code from those calls you would have seen an error message, eg.



check(SetAlphaOption("name",charname))
check(SetAlphaOption("player",charname))
check(SetAlphaOption("password","xxx"))



Now, testing the plugin gives:


Run-time error
Plugin: changechar (called from world: smaug)
Immediate execution
[string "Alias: "]:5: Plugin is not allowed to set this option





As a work-around you could call "Connect()" and then in the plugin callback "OnPluginConnect" send the character name, followed by the password.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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,342 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]