Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Weird issue where the plugin changes get undone
Weird issue where the plugin changes get undone
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Glorimus
(7 posts) 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>
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) 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 | 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.
9,019 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top