Find alias ala ctrl+f

Share your scripts and packages with other Mudlet users.
BrandNew
Posts: 21
Joined: Mon Sep 14, 2009 1:23 am

Re: Find alias ala ctrl+f

Post by BrandNew »

Does this script work in version 1.1.0? When I download it and use it, I get something that looks like this in the output when I do 'mfind shuyin':

3028: <0,179,0>Shuyin has been slaughtered by the awesome might of Romero Talnara, Her Soldier.
3028: <0,179,0>5302h, 4345m, 4755e, 10p exk- HSPFA Target: Pigeon mfind <115,0,115>shuyin<0,179,
0>

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Find alias ala ctrl+f

Post by Vadi »

Yeah it does actually, needs to be changed to use decho and all references to colors replaced by rgb numbers. I'll see about it later today.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Find alias ala ctrl+f

Post by Vadi »


User avatar
Puni
Posts: 1
Joined: Sun Oct 08, 2023 1:15 pm
Location: Helsinki, Finland
Contact:

Re: Find alias ala ctrl+f

Post by Puni »

The color codes did not work
3147: 179,0><0,179,0>,ozmo (up,
-----
3153: <115,0,
3153: 3007: 115><115,0,115><115,0,115><115,0,115>perisher<0,179,0><0,179,0><0,179,0><0,
3153: 3007: 2953: <0,179,0>179,0>,ozmo (up,down,n,s,e).2617: <0,179,0>Guardian<0,115,115>-----2638:
<0,
-----
3158: 3013: <115,0,
3158: 3013: 2956: <0,179,0>115><115,0,115><115,0,115><115,0,115>perisher<0,179,0><0,179,0><0,179,
0><0,179,0>,ozmo (up,down,n,
3158: s,e).2638: <0,179,
Changed to words ->

Code: Select all

local find = matches[2]
local data = getLines(0, getLineCount())

for i,j in ipairs(data) do
	local sm, em = string.find(j, find, 1, true)

	j = string.gsub(j, find, "<dark_green>" .. find .. "<dark_green>")

	if sm then
		cecho("\n<dark_green>".. i .. ": <green>" .. data[i-1])
		cecho("\n<dark_green>".. i .. ": <green>" .. j)
		cecho("\n<dark_green>".. i .. ": <green>" .. data[i+1])
		cecho("\n<green>-----")
		resetFormat()
	end
end
-----
2630: Your prayers are answered and you glean an understanding of your God.
2630: You are currently a cleric of Belinik's church, and you discern your level of favour to be
2630: acceptable in the eyes of your God.
-----
2715: Training room (n,s,w,church).
2715: A bulletin board labelled 'clerics'
2715: Kuolema Crowley the Cinedi
-----
@ Zombiemud org 3000 (Perisher)
"Itsekurin tie vaatii voittamaan tunteensa, elämään tyynesti ja oppimaan vaikeuksista."
- Eiji Yoshikawa, Musashi

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: Find alias ala ctrl+f

Post by demonnic »

The color codes you're showing are for decho, not cecho. I believe Vadi made mention of that a little earlier in the thread. But there's also a link to another package for the same thing earlier in the thread as well which may work better, might be worth checking out.

Post Reply