Mods to Nyss Script

Scripts and support for your favorite MUD client.
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Mods to Nyss Script

Postby Afu » Mon Nov 06, 2017 1:41 pm

#1) fix the way statitems displays all jumbled: line 32 in @statitems echo(stats[1] .. "\n\n") -- added an extra return because a blank line saves the eyes
#2) fix assist: in the autoassist trigger, add a new regex to the bottom ^(.+) attacks .*
#3) stat everything in a bag! totally robbed nyss's group statter:

this is an alias
alias: @statbag
regex: ^@statbag ?(gsay)?$

Code: Select all

local stats

local togsay = matches[2]

if NyyLIB.statbags == nil then
   cecho("<red>[statbags is nil]\n\n")
   return
end

for k,v in pairs(NyyLIB.statbags) do
   stats = sqliditem(v)

   -- need to distinguish between multiple return values

   if #stats > 1 then
      for nx=1,#stats,1 do
         if string.find(stats[nx], v .. " 1") then
            stats[1] = stats[nx]
         end      
      end
      echo("[multiple return values]\n\n")
   end

   if togsay == "gsay" then
      if stats[1] ~= nil then
         mud:send("gsay * " .. stats[1])
      else
         mud:send("gsay * " .. v .. " : not found in database. identify and mmail to katumi")
      end
   else
      if stats[1] ~= nil then
         echo(stats[1] .. "\n\n")
      else
         echo(v .. " : not found in database. identify and mmail to katumi\n\n")
      end
   end
end


Triggers:
Name: Bags
regex: [ ]+(.+)

Code: Select all

local itemname=matches[2]


itemname = string.gsub(itemname, "%(magic%)", "")
itemname = string.gsub(itemname, "%(illuminating%)", "")
itemname = string.gsub(itemname, "%(glowing%)", "")
itemname = itemname:trim()

table.insert(NyyLIB.statbags, 1, itemname)
enableTrigger("Bagend")


Name: BAGID
regex: (.*) \(carried\) \:

Code: Select all

NyyLIB.statbags = {}
enableTrigger("Bags")


name: bagend
regex: ^$

Code: Select all

disableTrigger("Bags")
disableTrigger("Bagend")
Vooku
Sojourner
Posts: 19
Joined: Tue Jul 24, 2007 5:02 pm

Re: Mods to Nyss Script

Postby Vooku » Mon Nov 06, 2017 2:35 pm

Awesome script. Saves a ton of copying/pasting.

Now we just need a @statworn *wink*
Vooku (50 Barb Shammy)
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Wed Nov 08, 2017 2:15 pm

You can change the code a little to stat people that u look at:

Gear capture trigger:
name: Lookstat
regex: ^\<.*\> (.*)$

Code: Select all

local itemname=matches[2]


itemname = itemname:trim()
itemname = string.gsub(itemname, "%(magic%)", "")
itemname = string.gsub(itemname, "%(illuminating%)", "")
itemname = string.gsub(itemname, "%(glowing%)", "")
itemname = itemname:trim()

table.insert(NyyLIB.lookstats, 1, itemname)
enableTrigger("Lookstatend")


name: Lookstatend
regex: ^$

Code: Select all

disableTrigger("Lookstat")
disableTrigger("Lookstatend")


name: LOOKID
regex: .* is a .+-sized level .*

Code: Select all

NyyLIB.lookstats = {}
enableTrigger("Lookstat")


alias
name: @statlook ?(say)?$
regex: ^@statlook ?(say)?$

Code: Select all

local stats

local togsay = matches[2]

if NyyLIB.lookstats == nil then
   cecho("<red>[lookstats is nil]\n\n")
   return
end

for k,v in pairs(NyyLIB.lookstats) do
   stats = sqliditem(v)

   -- need to distinguish between multiple return values

   if #stats > 1 then
      for nx=1,#stats,1 do
         if string.find(stats[nx], v .. " 1") then
            stats[1] = stats[nx]
         end      
      end
      echo("[multiple return values]\n\n")
   end

   if togsay == "say" then
      if stats[1] ~= nil then
         mud:send("say * " .. stats[1])
      else
         mud:send("say * " .. v .. " : not found in database. identify and mmail to katumi")
      end
   else
      if stats[1] ~= nil then
         echo(stats[1] .. "\n\n")
      else
         echo(v .. " : not found in database. identify and mmail to katumi\n\n")
      end
   end
end
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Thu Nov 09, 2017 6:13 pm

Added some easier train examples

created a tool to make identifying your zone easy:
alias: @zonen
regex: ^@zonen$

Code: Select all

mud:send ("say " .. map:getCurrentZone())


Code: Select all

-------------------------------------------------
--         Put your Lua functions here.        --
--                                             --
-- Note that you can also use external Scripts --
-------------------------------------------------
-- TODO: update inittrain path in Silverymoon

   testtrain = {
      {48518, "Shalyssa Lurialar"},
      {48850, "Forell Luckaun"},
      {48721, "Seipora Rein"}
   }

   dkloop = {
      {74698, "bankDeposit"},
      {74733, "captain"},
      {74696, "leader"},
      {74714, "leader"},
      {74731, "leader"},
      {74733, "archer"},
      {74746, "leader"},
      {74696, "soldier"},
      {74714, "soldier"},
      {74733, "archer"},
      {74731, "soldier"},
      {74733, "archer"},
      {74746, "soldier"},
      {74696, "soldier"},
      {74733, "archer"},
      {74714, "soldier"},
      {74733, "archer"},
      {74731, "soldier"},
      {74746, "soldier"},
      {74733, "archer"}
      
      
   }
   
   smtrain = {
      {84203, "bankDeposit"},
      {48882, "Willa O'Greensleeves"},
      {48873, "Aratha Sul"},
      {48524, "Lavis Ryl"},
      {48525, "Elaith Waterstill"},
      {48518, "Shalyssa Lurialar"},
      {48850, "Forell Luckaun"},
      {48721, "Seipora Rein"},
      {48681, "Corland Deepforge"},
      {48586, "Ersenas"},
      {49135, "Ultrumm"},
--      {49054, "Tathshandra Tyrar"},
--      {94648, "Otasit"},
      {49117, "devout priest"},
      {49036, "Dragor Keenblade"}
   }

   ashtrain = {
      {87415, "bankDeposit"},
--      {87411, "Stephan"},
--      {87402, "lich"},
      {87263, "gambler"},
      {87270, "bouncer"},
      {87271, "naked man"},
      {87272, "prostitute"},
      {87275, "aging prostitute"},
      {87276, "naked woman"},
      {87254, "Ashstone noble"},
      {87251, "Ashstone noble"},
      {87255, "Ashstone noble"},
      {87249, "Ashstone noble"},
      --{87314, "kindly priest"},
      {87253, "Ashstone noble"},
      {87258, "Ashstone noble"},
      {87257, "Ashstone noble"}
   }

   wdtrain = {
      {13402, "elite"},
      {13359, "elite"},
      {13343, "elite"},
      {13354, "master"},
      {13397, "master"}
--      {85354, "elite guard"},
--      {85358, "elite guard"},
--      {85356, "elite guard"},
--      {85410, "elite guard"},
--      {85421, "elite guard"},
--      {85349, "elite guard"}
   }

cmtrain = {
{44327, "crafty"},
{44328, "crafty"},
{44329, "crafty"},
{44330, "crafty"},
{44331, "crafty"},
{44332, "crafty"},
{44333, "crafty"},
{44334, "crafty"},
{44335, "crafty"},
{44336, "crafty"},
{44337, "crafty"},
{44338, "crafty"},
{44339, "crafty"},
{44340, "crafty"},
{44341, "crafty"},
{44342, "crafty"},
{44313, "orc"},
{44314, "orc"},
{44315, "orc"},
{44316, "orc"},
{44317, "orc"},
{44318, "orc"},
{44319, "orc"},
{44321, "orc"},
{44322, "orc"},
{44323, "orc"},
{44324, "orc"},
{44325, "orc"},
{44326, "orc"},
{71763, "bankDeposit"}
}

function configureTrain()
   -- disable any active triggers prior to enabling
   expandAlias("@resettrain", false)

   cecho("<green>[Laying train tracks...]\n")

   if trainList ~= nil then
      if _G[trainList] ~= nil then
         NyyLIB.smtrainstops = _G[trainList]
         trainList=nil
         return
      end
   end

   if map:getCurrentZone() == "Ashstone" then
      NyyLIB.smtrainstops = ashtrain
   elseif map:getCurrentZone() == "Silverymoon, Gem of the North" then
      NyyLIB.smtrainstops = smtrain
   elseif map:getCurrentZone() == "Northern Waterdeep Main City" then
      NyyLIB.smtrainstops = wdtrain
   elseif map:getCurrentZone() == "The Great Harbor of Waterdeep" then
      NyyLIB.smtrainstops = wdtrain
   elseif map:getCurrentZone() == "Dobluth Kyor - Main City" then
      NyyLIB.smtrainstops = dkloop
   elseif map:getCurrentZone() == "Viperstongue Outpost" then
      NyyLIB.smtrainstops = cmtrain
   end
end
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Thu Nov 09, 2017 6:16 pm

Now one would ask, why would I make a train of level 35-40 mobs?
Because i can kill these with a 10/20 and slowly burn through them.

But a level 30, can HIT them
every hit is exp and skillup

low levels should get exp from hitting things not from the mobs death.

thx drive thru
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Fri Nov 10, 2017 6:12 am

expanded exp for cm...if u better geared than me

Code: Select all

cmtrain = {
{44327, "bugbear"},
{44328, "bugbear"},
{44329, "bugbear"},
{44330, "bugbear"},
{44331, "bugbear"},
{44332, "bugbear"},
{44333, "bugbear"},
{44334, "bugbear"},
{44335, "bugbear"},
{44336, "bugbear"},
{44337, "bugbear"},
{44338, "bugbear"},
{44339, "bugbear"},
{44340, "bugbear"},
{44341, "bugbear"},
{44342, "bugbear"},
{44313, "orc"},
{44314, "orc"},
{44315, "orc"},
{44316, "orc"},
{44317, "orc"},
{44318, "orc"},
{44319, "orc"},
{44321, "orc"},
{44322, "orc"},
{44323, "orc"},
{44324, "orc"},
{44325, "orc"},
{44326, "orc"},
{41913, "duergar"},
{41914, "duergar"},
{41915, "duergar"},
{41916, "duergar"},
{41917, "duergar"},
{41930, "duergar"},
{41931, "duergar"},
{41932, "duergar"},
{41933, "duergar"},
{41934, "duergar"},
{41935, "duergar"},
{41936, "duergar"},
{41937, "duergar"},
{41938, "duergar"},
{41939, "duergar"},
{41940, "duergar"},
{41941, "duergar"},
{41942, "duergar"},
{41943, "duergar"},
{41944, "duergar"},
{41945, "duergar"},
{41946, "duergar"},
{41951, "duergar"},
{41952, "duergar"},
{41953, "duergar"},
{41954, "duergar"},
{41955, "duergar"},
{41957, "duergar"},
{44046, "duergar"},
{44048, "duergar"},
{44050, "duergar"},
{41934, "duergar"},
{41933, "duergar"},
{41932, "duergar"},
{41917, "duergar"},
{41918, "duergar"},
{41919, "duergar"},
{41920, "duergar"},
{41921, "duergar"},
{41922, "duergar"},
{41923, "duergar"},
{41924, "duergar"},
{41928, "duergar"},
{41929, "duergar"},
{41925, "duergar"},
{41926, "duergar"},
{41927, "duergar"},
{71763, "bankDeposit"}
}
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Sun Nov 12, 2017 2:54 am

Rewrote the kick trigger

Code: Select all

-- if autokick enabled send kick
--TODO: should change to recognize group leader bashing (trains). Can't kick if mounted

randumber = math.random(3)
if randumber == 1 then
  mycommand = "headbutt"
elseif randumber == 2 then
  mycommand = "kc"
elseif randumber == 3 then
  mycommand = "shieldp"
end   

if charData:get("autokick") and not checkMask("ran") then
   if groupList:ingroup(matches[2]) or matches[2] == "Your" then
    mud:send(mycommand)
   end
end
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Sun Nov 12, 2017 8:58 pm

Do what lil tells you to

regex:

Code: Select all

(Ashantia|Bele|Delmukeria|Eleari|Elenira|Eliri|Elniri|Emeile|Esara|Gava|Gurru|Ibele|Inama|Ixilliqim|Jiki|Kessarri|Korele|Lilabipple|Lilasena|Lilay|Lilaz|Lilebeple|Lileca|Lilele|Lilemma|Lilena|Lilesa|Lilia|Lilibepple|Lilibiple|Lilippople|Lilithelle|Lilixa|Lilna|Luma|Mersi|Runga|Ssessina|Ssuzzarra|Suzalize|Tule|Vorthra|Xerena|Elinshae|Minara|Emila|Rosera|Goruv|Paya|Soci) orders you to '(.*)'


code:

Code: Select all

mud:send("worship " .. matches[2])
mud:send(matches[3])
Nyyrazzilyss
Sojourner
Posts: 20
Joined: Tue May 19, 2015 6:30 am

Re: Mods to Nyss Script

Postby Nyyrazzilyss » Wed Nov 15, 2017 7:43 pm

A lot of the changes you've posted do work well, but just to mention a couple things

> Rewrote the kick trigger

The change you made having it alternate between kick, shieldpunch, or headbutt needs to also check class in it's decision making. The only class that has all 3 of those skills is warrior.

> created a tool to make identifying your zone easy:

The 'world' command was changed on the mud a year or two back to show you what zone you're current in.

> Do what lil tells you to

The regex on this trigger isn't left anchored to the start of the line.

emote Lilithelle orders you to 'give hole nyyrazzilyss'

would also trigger it

I'd probably also suggest if using something like that to make it a bit more complex by picking up any name, then checking the name against the included katumi database profilename for decision making

Thanks!
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Fri Nov 17, 2017 4:15 am

how to make a twoline version of this code, first you need 2 triggers instead of the big honkin one he uses:

regex:< (?:(\d+)h)?\/?(?:(\d+)H)? ?(?:(\d+)p)?\/?(?:(\d+)P)? ?(?:(\d+)v)?\/?(?:(\d+)V)? ?[\|]?((?:[a-z]+ [0-9+]+\|)+)? ?[\|]?((?:[0-9 ]\|)+) >

Code: Select all

-- < 416h/416H 110v/110V T: Zusuk TC: excellent E: ultrumm EC: nasty wounds EP: sit P: std >
-- < 1037h/1037H 134v/134V P: std >
-- < 824h/824H 547p/911P 111v/111V P: std >


NyyLIB = NyyLIB or {}

if matches[2] ~= "" then
   prompt:set("hp", tonumber(matches[2]))
end

if matches[3] ~= "" then
   prompt:set("maxhp", tonumber(matches[3]))
end

if matches[4] ~= "" then
   prompt:set("psp", tonumber(matches[4]))
else
   prompt:set("psp", nil)
end

if matches[5] ~= "" then
   prompt:set("maxpsp", tonumber(matches[5]))
else
   prompt:set("maxpsp", nil)
end

if matches[6] ~= "" then
   prompt:set("mv", tonumber(matches[6]))
end

if matches[7] ~= "" then
   prompt:set("maxmv", tonumber(matches[7]))
end

-- matches[8] is the powers prompt
if matches[8] ~= "" then
   prompt:decodePowers(matches[8])
end

-- matches[9] - spell slots

if matches[9] ~= "" then
   prompt:decodeSpellSlots(matches[9])
end

regex:< (?:T: ([A-Za-z ]+))? ?(?:TC: ([A-Za-z ]+))? ?(?:E: ([A-Za-z ]+))? ?(?:EC: ([A-Za-z ]+))? ?(?:EP: ([A-Za-z ]+))? (?:P: (.*)) >

Code: Select all

prompt:set("tank", matches[2]:trim())
prompt:set("tankcondition", matches[3]:trim())
prompt:set("enemy", matches[4]:trim())

if prompt:get("enemy") ~= "" then
   setEnemy( prompt:get("enemy") )
end

prompt:set("enemycondition", matches[5]:trim())
prompt:set("enemyposition", matches[6]:trim())
prompt:set("position", matches[7]:trim())

groupList:setHP(whoami(), prompt:get("hp"), prompt:get("maxhp") )

raiseEvent("promptEvent")


-- if no-one is known tanking, and the prompt shows combat look at the room

if groupList:whoTanking() == false and prompt:get("tank") ~= "" then
   groupList:incTanking(prompt:get("tank"))
   look:send()
end
Last edited by Afu on Fri Nov 17, 2017 4:43 am, edited 1 time in total.
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Fri Nov 17, 2017 4:30 am

Yes nyss some of those things are true, but people need examples of how to fix these things.
We're not going to sit around waiting for you to do everything.
i982
Sojourner
Posts: 7
Joined: Wed Oct 25, 2017 10:53 am

Re: Mods to Nyss Script

Postby i982 » Fri Nov 17, 2017 7:43 am

for the two-line triggers. i tried them and it still returns in combat message, [Can't fwalk while in combat]
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Sat Nov 18, 2017 7:57 am

regex

Code: Select all

< (?:(\d+)h)?\/?(?:(\d+)H)? ?(?:(\d+)p)?\/?(?:(\d+)P)? ?(?:(\d+)v)?\/?(?:(\d+)V)? ?[\|]?((?:[a-z]+ [0-9+]+\|)+)? ?[\|]?((?:[0-9 ]\|)+)? ?(?:T: ([A-Za-z ]+))? ?(?:TC: ([A-Za-z ]+))? ?(?:E: ([A-Za-z ]+))? ?(?:EC: ([A-Za-z ]+))? ?(?:EP: ([A-Za-z ]+))? ?(?:P: (.*))? >


changes to nyss script under captureprompt

Code: Select all

-- < 416h/416H 110v/110V T: Zusuk TC: excellent E: ultrumm EC: nasty wounds EP: sit P: std >
-- < 1037h/1037H 134v/134V P: std >
-- < 824h/824H 547p/911P 111v/111V P: std >


NyyLIB = NyyLIB or {}

if matches[2] ~= "" then
   prompt:set("hp", tonumber(matches[2]))
end

if matches[3] ~= "" then
   prompt:set("maxhp", tonumber(matches[3]))
end

if matches[4] ~= "" then
   prompt:set("psp", tonumber(matches[4]))
else
   prompt:set("psp", nil)
end

if matches[5] ~= "" then
   prompt:set("maxpsp", tonumber(matches[5]))
else
   prompt:set("maxpsp", nil)
end

if matches[6] ~= "" then
   prompt:set("mv", tonumber(matches[6]))
end

if matches[7] ~= "" then
   prompt:set("maxmv", tonumber(matches[7]))
end

-- matches[8] is the powers prompt
if matches[8] ~= "" then
   prompt:decodePowers(matches[8])
end

-- matches[9] - spell slots

if matches[9] ~= "" then
   prompt:decodeSpellSlots(matches[9])
end


if matches[10] ~= "" then
  prompt:set("tank", matches[10]:trim())
  prompt:set("tankcondition", matches[11]:trim())
  prompt:set("enemy", matches[12]:trim())

  if prompt:get("enemy") ~= "" then
     setEnemy( prompt:get("enemy") )
  end

  prompt:set("enemycondition", matches[13]:trim())
  prompt:set("enemyposition", matches[14]:trim())

  if groupList:whoTanking() == false and prompt:get("tank") ~= "" then
     groupList:incTanking(prompt:get("tank"))
     look:send()
  end

end
prompt:set("position", matches[15]:trim())

groupList:setHP(whoami(), prompt:get("hp"), prompt:get("maxhp") )

raiseEvent("promptEvent")


-- if no-one is known tanking, and the prompt shows combat look at the room
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Sat Nov 18, 2017 8:46 am

the above did an exptrain for about 1 mob then said im still in combat, but hey, its close :)
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Mon Dec 04, 2017 4:25 am

how to unlock the map

< Removed by administrator - See below for details >
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Mon Dec 04, 2017 2:04 pm

reasons to lock the map: none

reasons to unlock the map: all that buggy getting lost code is no longer broken.

if you are going to hardcode a map that is hidden, dont give them the map and try to hide it.
Nyyrazzilyss
Sojourner
Posts: 20
Joined: Tue May 19, 2015 6:30 am

Re: Mods to Nyss Script

Postby Nyyrazzilyss » Mon Dec 04, 2017 2:42 pm

Afu wrote:how to unlock the map


How to do so was never hidden/or difficult to find, with the expectation that anyone with programming knowledge that wanted to would do so anyways, not matter how much it was obscured or hidden.

I had always asked however for instructions not to be made public. With easy access to instructions, people will unlock the map and never have any experience with finding new locations on Toril.

Anyone that wants this already knows how to do it. The only people that are going to need those instructions are the ones that shouldn't have them (a new player).

Posting them does nothing other then make new players less likely to play.
User avatar
Shevarash
FORGER CODER
Posts: 2943
Joined: Fri Dec 29, 2000 6:01 am

Re: Mods to Nyss Script

Postby Shevarash » Mon Dec 04, 2017 3:15 pm

I've removed the instructions on how to unlock the map. Here's a little background:

The mapper in Nyy's client is a great feature and we're glad that it's available to new and existing players. However, we'd like to keep some mystery for new and old players alike that haven't been to every zone yet. While we can't (and don't want to) control what happens on your client, our policy is to not provide instructions on how to unlock the map on our forums, or link officially to any package that does so.

That said, we will review this policy internally. Feedback on this issue is welcome. You can feel free to post your thoughts in this thread or start a new one.
Shevarash -- Code Forger of TorilMUD
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Mon Dec 04, 2017 6:16 pm

I have no problem with this, but here's what's happening.

when you have an locked map, the fastwalks dont work, they get lost because of gaps

if you think for one second having a big black box up there with one square in it is inviting, you're wrong.

I suggest showing there's a room there, and greying it out in the future, this speedwalk takes you through unexplored area, are you sure?

doubt he's got those kinda chops tho
Nyyrazzilyss
Sojourner
Posts: 20
Joined: Tue May 19, 2015 6:30 am

Re: Mods to Nyss Script

Postby Nyyrazzilyss » Mon Dec 04, 2017 7:27 pm

Afu wrote:when you have an locked map, the fastwalks dont work, they get lost because of gaps


That would be by design. If you don't know how to walk between two room, @fwalk won't know it either.

@fwalk should never path through an unknown area. It should just error indicating there isn't a known path. If for any reason it isn't, bug it with an example and I will fix.
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Mon Dec 04, 2017 8:04 pm

lets not turn my nyss script mods into flames, i get it, thanks move on
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Fri Dec 08, 2017 9:31 pm

Alligator / Python farming in ghore

Caution, this does not check for mob condition.

New Folder: Farm

Triggers:

label: NorthernBoundary
substring: A Dividing Trail

Code: Select all

mud:send("south")


label: WesternBoundary
substring: A Trail West of the Alligator Marsh
substring: West of the Alligator Marsh

Code: Select all

mud:send("east")


label: SouthernBoundary
substring: A Trail South of the Alligator Marsh

Code: Select all

mud:send("north")


label: Roc
substring: ROARS

Code: Select all

mud:send("say aid of mage")
mud:send("kill roc")
mud:send("bash roc")


Label: DoneBleeding
substring: Your bleeding seems to be under control for the time being
substring: further won't help any

Code: Select all

enableTrigger("SearchCorpse")
--disableTrigger("DoneBleeding")
mud:send("search corpse")
--mud:send("holy shit! i think it worked!")


Label: StartBleeding
substring: Your wounds continue to bleed out of control
substring: You can't seem to stop the bleeding
substring: is dead

Code: Select all

disableTrigger("SearchCorpse")
mud:send("bandage self")


Label: SearchCorpse
substring: You don't find anything.

{code]mud:send("search corpse")[/code]

Label: FoundOne
substring: You find

Code: Select all

mud:send("get all corpse")
mud:send("put all hole")
mud:send("kick young")


Label: NoTarget
substring: Shieldpunch who

Code: Select all

mud:send("flee")


Label: KillGator
substring: You search exhaustively and conclude there is nothing to be found!
substring: You flee

Code: Select all

mud:send("kick young")


Label: KillPython
substring: Kick who

Code: Select all

mud:send("shieldpunch python")
Vooku
Sojourner
Posts: 19
Joined: Tue Jul 24, 2007 5:02 pm

Re: Mods to Nyss Script

Postby Vooku » Sat Dec 09, 2017 12:14 pm

Is searching the corpse right the kill missing from this?
Vooku (50 Barb Shammy)
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Tue Dec 12, 2017 2:17 pm

Vooku ^_^
No, it checks for bleeding on death, then begins searching.


new fun toy:


Alias:
Name: @die
Regex: ^@die$

Code: Select all

function die_sucka()
   mud:send("ASSASSINATE noble")
   --mud:send("tug suit")
   --tempTimer(1500,die_sucka)
end
tempTimer(1500,[[die_sucka()]])
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Thu Jan 04, 2018 5:47 am

Paladin changes to the 12/23 build
12/23/2017 NyyLIB011rc1b

Paladin:
in the
procPromptPal()

function, find his

Code: Select all

      if charData:get("autohands") then
         if percent < .5 then
            if timer:get("lay_on_hands") == nil and not timer:get("cooldown") then
               useMeleePower("lh")
               return
            end
         end
      end

right under that
put this:

Code: Select all

   
    -- hack for healing light
      if charData:get("autohands") and spell:getSlot(2) > 0 then
         if percent < .7 then
             cecho("** healing light fire **")
               spell:cast("HL")
               return
            end
         end
      -- AL
      if charData:get("autohands") and spell:getSlot(5) > 0 then
         if percent < .9 then
             cecho("** Aura of Life fire **")
               spell:cast("AL")
               return
            end
         end



^^ should prolly check for the buff once i got more than 1 slot for that 5th, ill fix soon :)
Last edited by Afu on Fri Jan 05, 2018 8:41 pm, edited 2 times in total.
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Fri Jan 05, 2018 7:51 pm

Advanced lookup for version: 12/23/2017 NyyLIB011rc1b


Script:

Code: Select all

-- bit of a hack but its what i do :)
-------------------------------------------------
--         Put your Lua functions here.        --
--                                             --
-- Note that you can also use external Scripts --
-------------------------------------------------
function gizl(args)
--function sqliditem(xitemname)
   local recs, row

   local retval = {}
  words = args:split("\ ")
   -- remove trailing (poisoned) from name   
   --xitemname=string.gsub(xitemname, "%(poisoned%)", "")
   --xitemname= xitemname:trim()

   --xitemname=string.gsub(xitemname, "'", "''")
   if words[6] ~= nil then
     cecho("\nWhat are you crazy? ill give you 5\n")
     recs = assert(NyyLIB.conn:execute([[SELECT item_name, short_stats FROM items WHERE short_stats LIKE '%]] .. words[1] .. [[%' AND short_stats like '%]] .. words[2] .. [[%' AND short_stats like '%]] .. words[3] .. [[%' AND short_stats like '%]] .. words[4] .. [[%' AND short_stats like '%]] .. words[5] .. [[%']]))      
     return
   elseif words[5] ~= nil then
     recs = assert(NyyLIB.conn:execute([[SELECT item_name, short_stats FROM items WHERE short_stats LIKE '%]] .. words[1] .. [[%' AND short_stats like '%]] .. words[2] .. [[%' AND short_stats like '%]] .. words[3] .. [[%' AND short_stats like '%]] .. words[4] .. [[%' AND short_stats like '%]] .. words[5] .. [[%']]))      
   elseif words[4] ~= nil then
     recs = assert(NyyLIB.conn:execute([[SELECT item_name, short_stats FROM items WHERE short_stats LIKE '%]] .. words[1] .. [[%' AND short_stats like '%]] .. words[2] .. [[%' AND short_stats like '%]] .. words[3] .. [[%' AND short_stats like '%]] .. words[4] .. [[%']]))      
   elseif words[3] ~= nil then
     recs = assert(NyyLIB.conn:execute([[SELECT item_name, short_stats FROM items WHERE short_stats LIKE '%]] .. words[1] .. [[%' AND short_stats like '%]] .. words[2] .. [[%' AND short_stats like '%]] .. words[3] .. [[%']]))      
  elseif words[2] ~= nil then
     recs = assert(NyyLIB.conn:execute([[SELECT item_name, short_stats FROM items WHERE short_stats LIKE '%]] .. words[1] .. [[%' AND short_stats like '%]] .. words[2] .. [[%']]))   
   else
     recs = assert(NyyLIB.conn:execute([[SELECT item_name, short_stats FROM items WHERE short_stats LIKE '%]] .. words[1] .. [[%']]))
  end
   
   row = recs:fetch({})

   while row do
      retval[#retval+1] = row[2]
      row = recs:fetch({})
   end

   recs:close()
   
   return(retval)
end


alias
@advfind
regex:@advfind (.*)

Code: Select all

local data

cecho("<red>[Attempting to identify " .. matches[2] .. "]\n")

data = gizl(matches[2])

for k,v in pairs(data) do
   cecho("\n<green>" .. v .. "\n")
end

cecho ("<red>[" .. #data .. " matches in database]\n")
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Fri Jan 05, 2018 7:54 pm

can also modify to be much more specific, change all the short_stats to long_stats
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Thu Jan 11, 2018 9:19 pm

regex: ^([A-Za-z]+) tells you '(worm|well|hole|wormhole|hol) ([A-Za-z]+)( .*)?'

code

Code: Select all

if matches[4] == "me" or matches[4] == "please" then
  send("worm " .. matches[2])
else
  send("worm " .. matches[4])
end
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Wed Jan 17, 2018 4:21 am

trying to work out a better bard script

...

this is my working idea
in the singer script

Code: Select all

      if prompt:get("psp") == prompt:get("maxpsp") and charData:get("_switch") == 0 and not charData:get("forcerenew") then
         if charData:get("_song") ~= charData:get("song") then
            if charData:get("_song") ~= ""  and charData:get("song") ~= "" then
               cecho("<red>\n[Max mana : switching songs]\n")
               if charData:get("_song") == "song of harming" or charData:get("_song") == "song of offensive disruption" then
                  music(charData:get("_instrument"), charData:get("_song"), charData:get("effect") )
               else
                  music(charData:get("_instrument"), charData:get("_song"), "")
               end
            elseif charData:get("_song") == "" and charData:get("song") == "song of renewal" then
               --   if max psp and singing renew switch to heal (or regen)

               if charData:get("level") >= 31 then
                  cecho("<red>\n[Max mana : switching songs to heal]\n")
                  music(charData:get("lute"), "song of healing", "")
               else
                  cecho("<red>\n[Max mana : switching songs to regen]\n")
                  music(charData:get("lute"), "song of regeneration", "")
               end
            end
         end
      end


replace with something like this

Code: Select all

      if prompt:get("psp") == prompt:get("maxpsp") and charData:get("_switch") == 0 and not charData:get("forcerenew") then
         if charData:get("_song") ~= charData:get("song") then
            if charData:get("_song") ~= ""  and charData:get("song") ~= "" then
               cecho("<red>\n[Max mana : switching songs]\n")
               if charData:get("_song") == "song of harming" or charData:get("_song") == "song of offensive disruption" then
                  music(charData:get("_instrument"), charData:get("_song"), charData:get("effect") )
               else
                  music(charData:get("_instrument"), charData:get("_song"), "")
               end
            elseif charData:get("_song") == "" and charData:get("song") == "song of renewal" then
               --   if max psp and singing renew switch to heal (or regen)

               if table.contains( {"awful", "pretty hurt", "nasty wounds", "small wounds"}, tankcondition ) then
                  cecho("<red>\n[Max mana : switching songs to heal]\n")
                  music(charData:get("lute"), "song of healing", "")
               end
            end
         end
      end




also needs one before the final end

Code: Select all

if not charData:get("_switch") and table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds", "small wounds"}, tankcondition ) and charData:get("song") == "song of offensive harmony" then
    music(charData:get("lute"), "song of healing", "")
    return
end


Code: Select all

if not charData:get("_switch") and table.contains( {"excellent", "few scratches"}, tankcondition ) and charData:get("song") == "song of healing" then
    music(charData:get("drum"), "song of offensive harmony", "")
    return
end
Last edited by Afu on Wed Jan 17, 2018 4:52 am, edited 5 times in total.
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Wed Jan 17, 2018 4:36 am

my paladin changes so far, just for solo



Code: Select all

function procPromptPal()
   local hp=prompt:get("hp")
   local maxhp=prompt:get("maxhp")
   local percent=hp/maxhp
   
   if not checkMask("pal") then
      return
   end
   
   if inCombat() then
      -- melee powers
      
      if charData:get("autohands") then
         if percent < .5 then
            if timer:get("lay_on_hands") == nil and not timer:get("cooldown") then
               useMeleePower("lh")
               return
            end
         end
      end

      if charData:get("autohands") and percent < .7 and spell:getSlot(2) > 0 then
         spell:cast("HL")
         return
      end

      if charData:get("autohands") and maxhp < 800 and spell:getSlot(5) > 0 and percent < .95 then
         spell:cast("AL")
         return
      end      
      -- abort if stunned

      if buff:get("stun") then
         return
      end
      
      -- taunts : need to change usage

      if charData:get("autodivchal") then
         if timer:get("divine_challenge") == nil and not timer:get("cooldown") then
            useMeleePower("dc")
            return
         end
      end

      if charData:get("autonemesis") then
         if timer:get("true_nemesis") == nil and not timer:get("cooldown") then
            if prompt:get("tank") ~= "" and prompt:get("tank") ~= whoami() then
               useMeleePower("tn")
               return
            end
         end
      end

      -- divine smite

      if charData:get("autodivsmite") then
         if timer:get("divine_smite") == nil and not timer:get("cooldown") then
            useMeleePower("ds")
            return
         end
      end

      -- 1h/shield melee powers
      if isIconActive("bolstering_strike") then
         if charData:get("autorcharge") then
               if timer:get("radiant_charge") == nil and not timer:get("cooldown") then
                  if prompt:get("enemyposition") == "std" then
                     useMeleePower("rc")
                     return
                  end
               end
         end

         if charData:get("autossmite") then
            if timer:get("shielding_smite") == nil and not timer:get("cooldown") then
               useMeleePower("ss")
               return
            end
         end

         if maxhp-hp > 100 then
            if charData:get("autobstrike") then
               if timer:get("bolstering_strike") == nil and not timer:get("cooldown") then
                  useMeleePower("bs")
                  return
               end
            end
         end

         if charData:get("autowsmite") then
            if timer:get("wrathful_smite") == nil and not timer:get("cooldown") then
               useMeleePower("ws")
               return
            end
         end

         if charData:get("autoesmite") then
            if timer:get("enervating_smite") == nil and not timer:get("cooldown") then
               useMeleePower("es")
               return
            end
         end

         --if charData:get("autobstrike") then
            --if timer:get("bolstering_strike") == nil and not timer:get("cooldown") then
            --   useMeleePower("bs")
            --   return
            --end
         --end
      end
   
      -- 2h powers
      if isIconActive("valiant_strike") then

         if charData:get("autothsmite") and prompt:get("enemyposition") == "std" then
            if timer:get("thunderous_smite") == nil and not timer:get("cooldown") then
               useMeleePower("ts")
               return
            end
         end

         if charData:get("autovstrike") then
            if timer:get("valiant_strike") == nil and not timer:get("cooldown") then
               useMeleePower("vs")
               return
            end
         end

         if charData:get("autobsmite") then
            if timer:get("brilliant_smite") == nil and not timer:get("cooldown") then
               useMeleePower("brs")
               return
            end
         end

         if charData:get("autotesmite") then
            if timer:get("terrifying_smite") == nil and not timer:get("cooldown") then
               useMeleePower("trs")
               return
            end
         end

         if charData:get("autowsmite") then
            if timer:get("whirlwind_smite") == nil and not timer:get("cooldown") then
               useMeleePower("wws")
               return
            end
         end
      end
   end
end

function SpellsPal()
   return
end


function divine_challenge(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end
   
   if xcommand == buttons.INIT then
      if charData:get("autodivchal") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autodivchal", xcommand)
   end
end

function true_nemesis(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end
   
   if xcommand == buttons.INIT then
      if charData:get("autonemesis") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autonemesis", xcommand)
   end
end

function divine_smite(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end
   
   if xcommand == buttons.INIT then
      if charData:get("autodivsmite") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autodivsmite", xcommand)
   end
end

function PopulateButtonCooldown(fname, xvalue)
   local label=findlabel(fname)

   -- Make sure button is still active
   if label ~= nil then
      if xvalue  > 0 then
         -- label:echo([[<p style="font-size:20px"><b><center><font color="]] .. charData:get("numcolor", true) .. [[">]] .. timedisplay(xvalue) .. [[</font></center></b></p>]])      
         label:echo([[<p style="font-size:20px"><b><center><font color="]] .. charData:get("numcolor", true) .. [[">]] .. xvalue .. [[</font></center></b></p>]])      
      else
         label:echo([[<p style="font-size:14px"><b><center><font color="white">   </font></center></b></p>]])
      end
   end
end

function lay_on_hands(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end
   
   if xcommand == buttons.INIT then
      if charData:get("autohands") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autohands", xcommand)
   end
end


function bolstering_strike(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autobstrike") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton("bolstering_strike", "autobstrike", xcommand)
   end
end

function radiant_charge(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autorcharge") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton("radiant_charge", "autorcharge", xcommand)
   end
end

function shielding_smite(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autossmite") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton("shielding_smite", "autossmite", xcommand)
   end
end

function enervating_smite(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autoesmite") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton("enervating_smite", "autoesmite", xcommand)
   end
end

function wrathful_smite(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autowsmite") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton("wrathful_smite", "autowsmite", xcommand)
   end
end

-- 2h melee powers

function valiant_strike(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autovstrike") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autovstrike", xcommand)
   end
end

function thunderous_smite(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autothsmite") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autothsmite", xcommand)
   end
end

function brilliant_smite(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autobsmite") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autobsmite", xcommand)
   end
end

function terrifying_smite(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autotesmite") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autotesmite", xcommand)
   end
end

function whirlwind_smite(fname, xcommand)
   -- if xcommand > 0, function being called re: timer
   
   if xcommand >= 0 then
      PopulateButtonCooldown(fname, xcommand)
   end

   if xcommand == buttons.INIT then
      if charData:get("autowsmite") then
         setLabelImage(fname, fname .. "-on.png")
      else
         setLabelImage(fname, fname .. "-off.png")
      end
      return
   end

   if xcommand == buttons.CLICK then
      shiftSkillButton(fname, "autowhsmite", xcommand)
   end
end
Last edited by Afu on Wed Jan 17, 2018 5:48 am, edited 2 times in total.
i982
Sojourner
Posts: 7
Joined: Wed Oct 25, 2017 10:53 am

Re: Mods to Nyss Script

Postby i982 » Wed Jan 17, 2018 5:02 am

here is what i got. how does it look in one piece?

Code: Select all

            function SingerScript(event)
   if checkMask("singer") then
local tankcondition= prompt:get("tankcondition")
local psp=prompt:get("psp")
local maxpsp=prompt:get("maxpsp")

      -- cast harmonious blessing if down and not moving
      if charData:get("autobless") then
         if not buff:get("harmonious_blessing") then
            if getSpellCount("harmonious_blessing") > 0 then
               if not spell:getMoving() then
                  spell:cast("hbl")
               end
            end
         end
      end


-- gonna switch if psp is still pretty good and im playing the wrong song based on the prompt conditions
-- ie, i dont wanna sing heal if tank is excellent, few scratches or small wounds

    if table.contains( {"awful", "pretty hurt", "nasty wounds"}, tankcondition ) and charData:get("song") == "song of offensive harmony" then
      music(charData:get("lute"), "song of healing", "")
      --return
    end

    if table.contains( {"excellent", "few scratches"}, tankcondition ) and charData:get("song") == "song of healing" then
      music(charData:get("drum"), "song of offensive harmony", "")
      --return
    end
 -- end mod to normal script
 
      if prompt:get("psp") == prompt:get("maxpsp") and charData:get("_switch") == 0 and not charData:get("forcerenew") then
         if charData:get("_song") ~= charData:get("song") then
            if charData:get("_song") ~= ""  and charData:get("song") ~= "" then
               cecho("<red>\n[Max mana : switching songs]\n")
               if charData:get("_song") == "song of harming" or charData:get("_song") == "song of offensive disruption" then
                  music(charData:get("_instrument"), charData:get("_song"), charData:get("effect") )
               else
                  music(charData:get("_instrument"), charData:get("_song"), "")
               end
            elseif charData:get("_song") == "" and charData:get("song") == "song of renewal" then
               --   if max psp and singing renew switch to heal or offensive harmony
               if charData:get("level") >= 31 then
            if table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds"}, tankcondition ) then
              music(charData:get("lute"), "song of healing", "")
                 else
              music(charData:get("drum"), "song of offensive harmony", "")
            end
               else
             if table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds"}, tankcondition ) then
                  music(charData:get("lute"), "song of regeneration", "")
                   else
              music(charData:get("drum"), "song of offensive harmony", "")
             end
               end
            end
         end
      end
   end
end
Last edited by i982 on Wed Jan 17, 2018 6:36 am, edited 2 times in total.
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Wed Jan 17, 2018 5:04 am

No You missed it, needs to be something like this

Code: Select all

-- this function will be called on all mud prompts
function SingerScript(event)
   if checkMask("singer") then

      -- cast harmonious blessing if down and not moving
      if charData:get("autobless") then
         if not buff:get("harmonious_blessing") then
            if getSpellCount("harmonious_blessing") > 0 then
               if not spell:getMoving() then
                  spell:cast("hbl")
               end
            end
         end
      end

      if prompt:get("psp") == prompt:get("maxpsp") and charData:get("_switch") == 0 and not charData:get("forcerenew") then
         if charData:get("_song") ~= charData:get("song") then
            if charData:get("_song") ~= ""  and charData:get("song") ~= "" then
               cecho("<red>\n[Max mana : switching songs]\n")
               if charData:get("_song") == "song of harming" or charData:get("_song") == "song of offensive disruption" then
                  music(charData:get("_instrument"), charData:get("_song"), charData:get("effect") )
               else
                  music(charData:get("_instrument"), charData:get("_song"), "")
               end
            elseif charData:get("_song") == "" and charData:get("song") == "song of renewal" then
               --   if max psp and singing renew switch to heal (or regen)

               if charData:get("level") >= 31 then
                  cecho("<red>\n[Max mana : switching songs to heal]\n")
                  music(charData:get("lute"), "song of healing", "")
               else
                  cecho("<red>\n[Max mana : switching songs to regen]\n")
                  music(charData:get("lute"), "song of regeneration", "")
               end
            end
         end
      end
   end

if not charData:get("_switch") and table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds", "small wounds"}, tankcondition ) and charData:get("song") == "song of offensive harmony" then
    music(charData:get("lute"), "song of healing", "")
    return
end

if not charData:get("_switch") and table.contains( {"excellent", "few scratches"}, tankcondition ) and charData:get("song") == "song of healing" then
    music(charData:get("drum"), "song of offensive harmony", "")
    return
end

end
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Wed Jan 17, 2018 5:39 am

ok i think i have it

from line 211 -- the begining of the singer script function to the end
replace all the code with this:

Code: Select all

function SingerScript(event)
   if checkMask("singer") then

      -- cast harmonious blessing if down and not moving
      if charData:get("autobless") then
         if not buff:get("harmonious_blessing") then
            if getSpellCount("harmonious_blessing") > 0 then
               if not spell:getMoving() then
                  spell:cast("hbl")
               end
            end
         end
      end


-- gonna switch if psp is still pretty good and im playing the wrong song based on the prompt conditions
-- ie, i dont wanna sing heal if tank is excellent, few scratches or small wounds

    if table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds"}, tankcondition ) and charData:get("song") == "song of offensive harmony" then
      music(charData:get("lute"), "song of healing", "")
      --return
    end

    if table.contains( {"excellent", "few scratches", "small wounds"}, tankcondition ) and charData:get("song") == "song of healing" then
      music(charData:get("drum"), "song of offensive harmony", "")
      --return
    end
 -- end mod to normal script
 
      if prompt:get("psp") == prompt:get("maxpsp") and charData:get("_switch") == 0 and not charData:get("forcerenew") then
         if charData:get("_song") ~= charData:get("song") then
            if charData:get("_song") ~= ""  and charData:get("song") ~= "" then
               cecho("<red>\n[Max mana : switching songs]\n")
               if charData:get("_song") == "song of harming" or charData:get("_song") == "song of offensive disruption" then
                  music(charData:get("_instrument"), charData:get("_song"), charData:get("effect") )
               else
                  music(charData:get("_instrument"), charData:get("_song"), "")
               end
            elseif charData:get("_song") == "" and charData:get("song") == "song of renewal" then
               --   if max psp and singing renew switch to heal or offensive harmony
               if charData:get("level") >= 31 then
            if table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds"}, tankcondition ) then
              music(charData:get("lute"), "song of healing", "")
                 else
              music(charData:get("drum"), "song of offensive harmony", "")
            end
               else
             if table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds"}, tankcondition ) then
                  music(charData:get("lute"), "song of regeneration", "")
                   else
              music(charData:get("drum"), "song of offensive harmony", "")
             end
               end
            end
         end
      end
   end
end
Afu
Sojourner
Posts: 39
Joined: Sun Oct 01, 2017 3:58 pm

Re: Mods to Nyss Script

Postby Afu » Wed Jan 17, 2018 6:33 am

finished bard script, thanks areh

Code: Select all

function SingerScript(event)
   if checkMask("singer") then
  local tankcondition = prompt:get("tankcondition")
   local psp = prompt:get("psp")
   local maxpsp = prompt:get("maxpsp")
   
      -- cast harmonious blessing if down and not moving
      if charData:get("autobless") then
         if not buff:get("harmonious_blessing") then
            if getSpellCount("harmonious_blessing") > 0 then
               if not spell:getMoving() then
                  spell:cast("hbl")
               end
            end
         end
      end


-- gonna switch if psp is still pretty good and im playing the wrong song based on the prompt conditions
-- ie, i dont wanna sing heal if tank is excellent, few scratches or small wounds
    if psp > 50 then
      if table.contains( {"awful", "pretty hurt", "nasty wounds"}, tankcondition ) and charData:get("song") == "song of offensive harmony" then
        music(charData:get("lute"), "song of healing", "")
        --return
      end
      if table.contains( {"excellent", "few scratches"}, tankcondition ) and charData:get("song") == "song of healing" then
        music(charData:get("drum"), "song of offensive harmony", "")
        --return
      end
      end
 -- end mod to normal script
 
      if prompt:get("psp") == prompt:get("maxpsp") and charData:get("_switch") == 0 and not charData:get("forcerenew") then
         if charData:get("_song") ~= charData:get("song") then
            if charData:get("_song") ~= ""  and charData:get("song") ~= "" then
               cecho("<red>\n[Max mana : switching songs]\n")
               if charData:get("_song") == "song of harming" or charData:get("_song") == "song of offensive disruption" then
                  music(charData:get("_instrument"), charData:get("_song"), charData:get("effect") )
               else
                  music(charData:get("_instrument"), charData:get("_song"), "")
               end
            elseif charData:get("_song") == "" and charData:get("song") == "song of renewal" then
               --   if max psp and singing renew switch to heal or offensive harmony
               if charData:get("level") >= 31 then
            if table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds"}, tankcondition ) then
              music(charData:get("lute"), "song of healing", "")
                 else
              music(charData:get("drum"), "song of offensive harmony", "")
            end
               else
             if table.contains( {"awful", "pretty hurt", "nasty wounds", "few wounds"}, tankcondition ) then
                  music(charData:get("lute"), "song of regeneration", "")
                   else
              music(charData:get("drum"), "song of offensive harmony", "")
             end
               end
            end
         end
      end
   end
end

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 4 guests