joeware - never stop exploring... :)

Information about joeware mixed with wild and crazy opinions...

Major MUD Scripts…

by @ 10:51 pm on 6/19/2008. Filed under tech

Wow I went looking and actually found the SLIQ Major MUD scripts I talked about in the last post. Or at least I think I found most of them, even then I broke the stuff up into multiple files and modules.

I was poking around in one piece and found this section which was one of my favorite pieces as it always surprised the crap out of newbies who thought they could steal from me…

// Thief Routine
  if instr(line,”bumps you”) then
    dim pointer as integer
    pointer = 1
    if instr(line,”:”) then
      if instr(line,”:”) > instr(line,”)”) then
        pointer=instr(line,”:”)+1
      else
        pointer=instr(line,”)”)+1
      end if
    end if
    thief = MyMid(line,pointer,instr(line,”bump”)-pointer-1)
    Attack(thief)  
    fighting = TRUE
    monster1 = thief
    send
  end if

Basically you had people who would figure out that someone was running a script and then send a thief in to rob them blind. Up until I wrote my script, the scripts were so simple the thieves could get away with it because the script wouldn’t attack back. I sat and watched my character get robbed one day and said, hmm that isn’t happening to me again. So I wrote this routine to attack the thief that tried to rob me. Another routine would then chase the thief if he started running. Definitely not the normal script handling. 🙂

I also had this cute little routine

// Character attacking Normal way
  if instr(line,”moves to attack you”)>2 and instr(line,”attack young”) = 0 and instr(trueLine,”You”)=0 then
    print “>>”+ line
    if instr(line,other) then
      send “Forgive ” + other
      goto end_parse
    end if
    lstart=instr(line,”moves”)-1
      if instr(line,”:”) > instr(line,”)”) then
        lslash=instr(line,”:”)+1
      else
        lslash=instr(line,”)”)+1
      end if
    command1=MyMid(line,lslash,lstart-lslash)
    if myInfo.pvp <> “” then
      if instr(command1,myInfo.pvp) then
        monster1 = myInfo.pvp
        fighting = TRUE
        Attack(monster1)
        goto end_parse
      end if
    end if
    if (myInfo.log AND DEBUG) then print #1, time+”   Under Attack>”+command1
    if caution_level = 9 then call get_out
    sayMessage(“Under Attack–>”+line)
  end if

That would attack anyone who attacked me, but for bonus it would tell the other character that the first character was “tagged” to to also attack.

Here was a routine that would have one tagged character help another that dropped to the ground

// Somebody hit the ground, find out who and help. 
  if (instr(line,”drops to the ground”)) then
    lstart=instr(line,”drops to the ground”)-1
    lslash=instr(line,”:”)+1
    command1=MyMid(line,lslash,lstart-lslash)
    if (myInfo.log AND DEBUG) then print #1, time+”   Someone hit the ground ->”+command1
    if instr(other,command1) then
      heal(command1)
      send “aid “+command1
      if fighting then Attack(” “)
    else
      if other <> “*none*” then send “!Oh That’s Got To Hurt!”
    end if
  end if
     

I love this stuff, so much fun. I am such a geek. 🙂

 

     joe

Rating 4.33 out of 5

Comments are closed.

[joeware – never stop exploring… :) is proudly powered by WordPress.]