Mind helping me with tintin++ scripts? Suggestions?

... A place to ask for help on any topic whether it be starting out to player killing to IT issues.
Post Reply
rixie
Posts: 52
Joined: Thu May 14, 2015 7:32 pm

Mind helping me with tintin++ scripts? Suggestions?

Post by rixie » Tue Dec 15, 2015 5:24 am

I'm having trouble with my loc and loc object weaves. I want to capture this variable in weaves so I can use it in my travel weaves. Some suguestions would be much appreciated.

I am not using wintin for the record. I'm using tintin.

#action {*Basel Gill - [%w]$}={#var cae %0;#showme $cae} @ {5}

As you can see here, i want to capture the variable.

I've tried it this way: #action {*Basel Gill - [{%w}]$}={#var cae %1;#showme $cae} @ {5}

I didn't want to use the whole {Hurin - [%w] - somewhere far north of here.$}{#var fd %1;#showme $fd}
because the part after the variable can change depending on where I am and that will affect my #action script.
Just thought It'd be a better idea to write script like this: {^Hurin - [%w]$}{#var fd %1;#showme $fd}
however the %w is not working and hte variable isn't being captured. I've tried using %0,%1 but nothing seems to work.

Anyone familiar with wintin++? Suggestions would be much appreciated.

Mirri
Posts: 1
Joined: Fri Dec 11, 2015 8:15 pm

Re: Mind helping me with tintin++ scripts? Suggestions?

Post by Mirri » Tue Dec 15, 2015 5:34 pm

Can't help you. I'm stuck on good old reliable Wintin 95. :D

rixie
Posts: 52
Joined: Thu May 14, 2015 7:32 pm

Re: Mind helping me with tintin++ scripts? Suggestions?

Post by rixie » Wed Dec 16, 2015 12:12 am

I solved the problem.

Hurin - [nsevxzmeylijqry] - somewhere far north of here.

Here's the solution: {^Hurin - [%1] - %2.$}{#var fd %1;#showme $fd;#var loc %2}

I can use the variables in the following scripts: #alias {tfd}{channel 'travel' $fd}
#alias {lw}{nar 'I sense shadowspawn $loc of <areaname>'}

Jomin
Posts: 160
Joined: Thu Feb 19, 2015 3:54 pm
Location: White Tower Libraries or Deepest Wiltshire, UK

Re: Mind helping me with tintin++ scripts? Suggestions?

Post by Jomin » Sat Dec 19, 2015 10:35 pm

This is a fragment of a script I used a while ago to parse location weave results, it is probably a bit complex for what you want, but I used to store all the results from the last locate weave in a variable "loc_ttable" where each result was assigned a monotonically increasing index number "location_count" and then had an alias to save any "interesting" ones to a second "loc_ptable" - that would automatically be erased at 1am on the first of the month by a separate timing routine. It might be useful to show the detail it is possible to use to parse things in TinTin++ (!):

Code: Select all

#ACTION       {^%*%s- [%3] - somewhere{ | far | very far | extremely far }{north of |northeast of |east of |southeast of |south of |southwest of |west of |northwest of |around }here%6$}
{
	#nop locate_weave_scripts;
	#format location_now {%T};
	#unvariable loc_ttable;
	#unvariable loc_totals;
	#variable location_type @mud_weave_name{${weave_name}};
	weave_success
	#if {&{location_count}}
	{
		#math location_count 1+$location_count
	};
	#else
	{
		#variable location_count 1
	};
	#variable location_color {};
	#switch {"%1"}
	{
		#case {"a myrddraal"}
		{
			#variable location_color <118>;
			#break
		};
		#case {"a dreadlord"}
		{
			#variable location_color <118>;
			#break
		};
		#case {"a seanchan"}
		{
			#variable location_color <158>;
			#break
		};
		#case {"a Ko'bal trolloc"}
		{
			#variable location_color <118>;
			#break
		};
		#case {"a Dha'vol trolloc"}
		{
			#variable location_color <118>;
			#break
		};
		#case {"a Ghar'ghael trolloc"}
		{
			#variable location_color <118>;
			#break
		};
		#case {"a Dhai'mon trolloc"}
		{
			#variable location_color <118>;
			#break
		};
		#default
		{
			#nop
		}
	};
	#if {"$location_color"==""}
	{
		#switch {"%6"}
		{
			#case {"."}
			{
				#variable location_color ${cs_def};
				#break
			};
			#case {", carried by a fade."}
			{
				#variable location_color <518>;
				#break
			};
			#case {", carried by a trolloc."}
			{
				#variable location_color <518>;
				#break
			};
			#case {", carried by a myrddraal."}
			{
				#variable location_color <518>;
				#break
			};
			#case {", carried by a dreadlord."}
			{
				#variable location_color <518>;
				#break
			};
			#case {", carried by a seanchan."}
			{
				#variable location_color <558>;
				#break
			};
			#default
			{
				#nop
			}
		}
	};
	#switch {"%4"}
	{
		#case {" "}
		{
			#variable location_distance {}
		};
		#case {" far "}
		{
			#variable location_distance F
		};
		#case {" very far "}
		{
			#variable location_distance VF
		};
		#case {" extremely far "}
		{
			#variable location_distance EF
		};
		#default
		{
			#echo {Don't understand "%3" as a distance from location weave}
		}
	};
	#switch {"%5"}
	{
		#case {"north of "}
		{
			#variable location_dir N;
			#break
		};
		#case {"northeast of "}
		{
			#variable location_dir NE;
			#break
		};
		#case {"east of "}
		{
			#variable location_dir E;
			#break
		};
		#case {"southeast of "}
		{
			#variable location_dir SE;
			#break
		};
		#case {"south of "}
		{
			#variable location_dir S;
			#break
		};
		#case {"southwest of "}
		{
			#variable location_dir SW;
			#break
		};
		#case {"west of "}
		{
			#variable location_dir W;
			#break
		};
		#case {"northwest of "}
		{
			#variable location_dir NW;
			#break
		};
		#case {"around "}
		{
			#variable location_dir A;
			#break
		};
		#default
		{
			#echo {Don't understand "%4" as a direction from location weave}
		}
	};
	#if {"%6"=="."}
	{
		#echo {${location_count}:${location_now}:${location_color}%3:"%1":${location_distance}${location_dir}${cs_def}};
		#variable t_locs[when] ${location_now};
		#variable t_locs[mdate] {${MUD_month}, ${MUD_year}};
		#variable t_locs[code] %3;
		#variable t_locs[what] %1;
		#variable t_locs[carrier] {};
		#variable t_locs[fromwhere] $actroomname;
		#variable t_locs[fromarea] $maproomarea;
		#variable t_locs[dir] ${location_dir};
		#variable t_locs[dist] ${location_distance};
		#variable t_locs[type] ${location_type};
		#variable t_locs[level] {${practice[$character][locate life]}%};
		#variable t_locs[color] ${location_color};
		#variable loc_ttable[${location_count}] ${t_locs};
		#unvariable t_locs;
};
	#else
	{
		#regexp {%6} {, carried by %*.} {#VARIABLE location_carrier &1};
		#echo {${location_count}:${location_now}:${location_color}%3:"%1", on ${location_carrier}:${location_distance}${location_dir}${cs_def}};
		#variable t_locs[when] ${location_now};
		#variable t_locs[mdate] {${MUD_month}, ${MUD_year}};
		#variable t_locs[code] %3;
		#variable t_locs[what] %1;
		#variable t_locs[carrier] ${location_carrier};
		#variable t_locs[fromwhere] $actroomname;
		#variable t_locs[fromarea] $maproomarea;
		#variable t_locs[dir] ${location_dir};
		#variable t_locs[dist] ${location_distance};
		#variable t_locs[type] ${location_type};
		#variable t_locs[level] {${practice[$character][locate object]}%};
		#variable loc_ttable[${location_count}] ${t_locs};
		#unvariable t_locs;
	};
	#line GAG
}
{5}
cs_XXX variables are text formatting codes if there are any others that don't make sense, ask me...

rixie
Posts: 52
Joined: Thu May 14, 2015 7:32 pm

Re: Mind helping me with tintin++ scripts? Suggestions?

Post by rixie » Sun Jan 03, 2016 3:14 am

Thanks for the reply. I'll make sure I ask questions as I'm new to tintin++ and I'm not too familiar with C. I've copied your script. I keep it simple as I'm new to tintin++ and I didn't want to make things overly complicated for myself.

Post Reply