Hi,
Sorry to bother again. I'm still pretty new to coding in mushclient at all and even newer to lua. What I am trying to do with what help files and examples I have found is write a script that will set potential afflictions.
Basically the trigger gets what the potential affliction is it will give me a symptom and I have in the trigger what it is. This world again has an extremely complex combat system so I need to optimize my code. I want to know if someone call look over what I have before I change everything to find out it's wrong or doesn't work.
In my script file there is this function:
function myafflictions (affl)
if potaffl1 == nil then
SetVariable ("potaffl1", affl)
return
else
if potaffl2 == nil then
SetVariable ("potaffl2", affl)
return
else
if potaffl3 == nil then
SetVariable ("potaffl3", affl)
return
else
if potaffl4 == nil then
SetVariable ("potaffl4", affl)
return
else
if potaffl5 == nil then
SetVariable ("potaffl5", affl)
return
else
if potaffl6 == nil then
SetVariable ("potaffl6", affl)
return
end -- if
end -- if
end -- if
end -- if
end -- if
end -- if
end -- function myafflictions
It's purpose is to put the affliction name into which ever variable is empty then exit.
Then my prompt trigger which this isn't fully coded yet has these lines:
if GetVariable ("illusion") == "0" and
GetVariable ("potaff1") ~= "coating" then
SetVariable ('GetVariable("potaff1")', 1)
end -- if
The trigger itself is this :
* flays the hard waxy coating from you.
in the box below:
local affl = "coating"
if GetVariable ("fighting") == "0" then
SetVariable ("fighting", "1")
Note "Fightmode ON"
end -- if
myafflictions (affl)
Send to Script
Sorry to bother again. I'm still pretty new to coding in mushclient at all and even newer to lua. What I am trying to do with what help files and examples I have found is write a script that will set potential afflictions.
Basically the trigger gets what the potential affliction is it will give me a symptom and I have in the trigger what it is. This world again has an extremely complex combat system so I need to optimize my code. I want to know if someone call look over what I have before I change everything to find out it's wrong or doesn't work.
In my script file there is this function:
function myafflictions (affl)
if potaffl1 == nil then
SetVariable ("potaffl1", affl)
return
else
if potaffl2 == nil then
SetVariable ("potaffl2", affl)
return
else
if potaffl3 == nil then
SetVariable ("potaffl3", affl)
return
else
if potaffl4 == nil then
SetVariable ("potaffl4", affl)
return
else
if potaffl5 == nil then
SetVariable ("potaffl5", affl)
return
else
if potaffl6 == nil then
SetVariable ("potaffl6", affl)
return
end -- if
end -- if
end -- if
end -- if
end -- if
end -- if
end -- function myafflictions
It's purpose is to put the affliction name into which ever variable is empty then exit.
Then my prompt trigger which this isn't fully coded yet has these lines:
if GetVariable ("illusion") == "0" and
GetVariable ("potaff1") ~= "coating" then
SetVariable ('GetVariable("potaff1")', 1)
end -- if
The trigger itself is this :
* flays the hard waxy coating from you.
in the box below:
local affl = "coating"
if GetVariable ("fighting") == "0" then
SetVariable ("fighting", "1")
Note "Fightmode ON"
end -- if
myafflictions (affl)
Send to Script