Results 1 to 5 of 5

Thread: Lich -- 1030 Script

  1. #1

    Default Lich -- 1030 Script

    So, I'm trying to write a script that does open 1030 and loots the number of times given the number of death lines. It seems to be a bit wonky and I really can't figure out why for the life of me. Double loots when shouldn't and doesn't exit.

    --- Lich: armageddon active.
    [armageddon]^prep 1030
    [armageddon]^cast
    >
    You change your tune slightly, adding the element for Song of Sonic Disruption to your song...
    Your spellsong is ready.
    >
    You weave another verse into your harmony.
    The dull golden nimbus surrounding a triton radical suddenly begins to glow brightly and then disappears.
    CS: +517 - TD: +388 + CvA: +25 + d100: +64 == +218
    Warding failed!
    A triton radical reels under the force of the sonic vibrations!
    Sound waves disrupt for 106 damage!
    ... 90 points of damage!
    The triton radical's shoulder joint explodes, severing shield arm.

    CS: +517 - TD: +365 + CvA: +20 + d100: +42 == +214
    Warding failed!
    A siren reels under the force of the sonic vibrations!
    Sound waves disrupt for 104 damage!
    ... 95 points of damage!
    The siren's neck explodes launching her head into the air.
    The siren gives a plaintive wail before she slumps to her side and dies.
    The brilliant luminescence fades from around a siren.
    The bright luminescence fades from around a siren.
    The silvery luminescence fades from around a siren.

    Sing Roundtime 3 Seconds.
    >
    [armageddon: The siren gives a plaintive wail before she slumps to her side and]
    [armageddon: 1]
    [armageddon: The siren gives a plaintive wail before she slumps to her side and]
    [armageddon: 2]

    Code:
    loot = 0
    while true
    	put "prep 1030"
    	put "cast"
    	line = waitfor("Roundtime", "Your armor prevents the song from working correctly", "wait (1|2|3)", "Warding failed")
    	if line =~ /Your armor prevents the song from working correctly/
    		next
    	elsif line =~ /wait/
    		sleep 1
    		next
    	elsif line =~ /Warding failed/i
    		until (kills = matchfindexact("twitching ?", "? goes still", "begins to dissolve ?", "gurgling ?", "? dies", "emits ? hollow scream")) == "Roundtime"
    			if kills
    				loot += 1
    				echo kills
    				echo loot
    			else
    				exit
    			end
    		end
    		while loot > 0
    			put "loot"
    			loot -= 1
    			echo loot
    		end
    		exit
    	else
    		exit
    	end
    end
    I've also tried using "if kills.to_i == 0" instead of "if kills" but I get similar results. Any advice?

  2. #2

    Default

    You need to add the string, "Sing ?" to your "until kills = matchfindexact() == 'Roundtime'" line. It isn't matching the roundtime and is therefore stuck in the matchfind, hence, no looting.
    Code:
    loot = 0
    while true
    	put "prep 1030"
    	put "cast"
    	line = waitfor("Roundtime", "Your armor prevents the song from working correctly", "wait (1|2|3)", "Warding failed")
    	if line =~ /Your armor prevents the song from working correctly/
    		next
    	elsif line =~ /wait/
    		sleep 1
    		next
    	elsif line =~ /Warding failed/i
    		until (kills = matchfindexact("twitching ?", "? goes still", "begins to dissolve ?", "gurgling ?", "? dies", "emits ? hollow scream", "Sing ?")) == "Roundtime"
    			if kills
    				loot += 1
    				echo kills
    				echo loot
    			else
    				exit
    			end
    		end
    		while loot > 0
    			put "loot"
    			loot -= 1
    			echo loot
    		end
    		exit
    	else
    		exit
    	end
    end
    Last edited by Belathus; 02-16-2007 at 08:55 PM. Reason: Code tags.
    -Andrew

  3. #3

    Default

    And, now that I think about it... the kills variable is completely superfluous. You can abbreviate that until loop to just this:
    Code:
    until matchfindexact("twitching ?", "? goes still", "begins to dissolve ?", "gurgling ?", "? dies", "emits ? hollow scream", "Sing ?") == "Roundtime"
    	loot += 1
    end
    -Andrew

  4. #4

    Default

    cool, I changed the code around but I can't seem to get the bugger to exit . . . I've tried putting the exit line in a number of places; no dice.

    Code:
    loot = 0
    while true
    	put "prep 1030"
    	put "cast"
    	line = waitfor("Roundtime", "Your armor prevents the song from working correctly", "wait (1|2|3)", "Warding failed")
    	if line =~ /Your armor prevents the song from working correctly/
    		next
    	elsif line =~ /wait/
    		sleep 1
    		next
    	elsif line =~ /Warding failed/i
    		until matchfindexact("twitching ?", "? goes still", "begins to dissolve ?", "gurgling ?", "? dies", "emits ? hollow scream", "Sing ?") == "Roundtime"
    			loot += 1
    			while loot > 1
    				put "loot"
    				loot -= 1
    			end
    		end
    		exit
    	else
    		exit
    	end
    end

  5. #5

    Default

    got it working

    thanks.

Similar Threads

  1. Replies: 2
    Last Post: 01-06-2014, 07:14 PM
  2. Replies: 9
    Last Post: 10-29-2012, 09:05 PM
  3. Lich script help
    By Rolis in forum Scripting Discussion
    Replies: 1
    Last Post: 11-24-2011, 07:38 PM
  4. Lich script help
    By Flessen in forum The Lich Project
    Replies: 6
    Last Post: 01-28-2008, 09:42 PM
  5. How do I run a wiz/sf script with lich?
    By Tenzle in forum Scripting Discussion
    Replies: 1
    Last Post: 05-14-2007, 10:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •