wc3 tag

dorbian

New Member
Reaction score
1
As i had no clue on where to put this, i think this is the best possible location :)

I have a personal wiki which i use for all my programming snippets, as i code in many different languages the syntax highlighting makes my life easier.
Now for Warcraft 3 i noticed that TheHelper is using the wc3 tag on the forum, but i have no clue on where to find this..

is it publicly available somewhere or was it custom build for specifically this site, and is it possible to get a copy of the system or the rules used ?

For JASS I've been busy making one for Geshi as it's widely supported and i hope to use it for both my blog and my snippet library.

Cheers,

-D
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
The wc3 tags for the forum were made by phyrex1an using the Geshi system, I believe. It will be up to him if he wants to offer you the coding, but I think this has been asked in the past and generally the answer is no.
 

dorbian

New Member
Reaction score
1
I can understand if he would refuse, i know how much work goes into building one.
Otherwise i can always have a look into building one myself :) ( as it would have been his idea i would credit him in the source as such if he wouldn't mind )

Cheers for the reply and i'll wait until he has replied himself before i do anything.

-D
 

Artificial

Without Intelligence
Reaction score
326
I made one myself two or three (or more?) years ago. The code might be a bit messy, and I don't really remember how it works (nor do I have much interest in reading through it), but it might be helpful for you if you manage to understand or use it.

PHP:
	function wc3_trigger($content) {
		// ----- Configuration
			$path     = '/Test/images/GUI/';
			$keywords = array('AI', 'Animation', 'Special Effect', 'Camera', 'Cinematic', '--------', 'Destructible',
							  'Dialog', 'Environment', 'Game Cache', 'Game', 'Neutral Building', 'Hero',
							  'Item', 'Melee', 'Player Group', 'Player', 'Quest', 'Leaderboard', 'Multiboard',
							  'Region', 'Set', 'Sound', 'Unit Group', 'Unit',
							  'Selection', 'Wait', 'Visibility', 'Actions', 'Then - Actions', 'Else - Actions', 'Loop - Actions',
							  'Conditions', 'If - Conditions', 'Countdown', 'Time', 'Custom script', 'Map initialization', 'Skip remaining actions', 'Trigger', 'Floating Text', 'Image', 'Lightning', 'Ubersplat', 'Do nothing'
							  );
			$images   = array('Actions-AI.jpg', 'Actions-Animation.jpg', 'Actions-Animation.jpg', 'Actions-Camera.jpg', 'Actions-Camera.jpg', 'Actions-Comment.jpg',
						  	  'Actions-Destructibles.jpg', 'Actions-Dialog.jpg', 'Actions-Environment.jpg', 'Actions-SetVariables.jpg', 'Actions-Game.jpg',
							  'Actions-Goldmine.jpg', 'Actions-Hero.jpg', 'Actions-Item.jpg', 'Actions-Melee.jpg', 'Actions-PlayerGroup.jpg',
							  'Actions-Player.jpg', 'Actions-Quest.jpg', 'Actions-Quest.jpg', 'Actions-Quest.jpg', 'Actions-Region.jpg', 'Actions-SetVariables.jpg', 'Actions-Sound.jpg',
							  'Actions-UnitGroup.jpg', 'Actions-Unit.jpg', 'Actions-UnitSelection.jpg', 'Actions-Wait.jpg', 'Actions-Visibility.jpg',
							  'Editor-TriggerAction.jpg', 'Editor-TriggerAction.jpg', 'Editor-TriggerAction.jpg', 'Editor-TriggerAction.jpg', 'Editor-TriggerCondition.jpg', 'Editor-TriggerCondition.jpg', 'Events-Time.jpg', 'Events-Time.jpg', 
							  'Actions-Nothing.jpg', 'Actions-Nothing.jpg', 'Actions-Nothing.jpg', 'Actions-Nothing.jpg', 'Actions-Nothing.jpg', 'Actions-Nothing.jpg', 'Actions-Nothing.jpg', 'Actions-Nothing.jpg', 'Actions-Nothing.jpg', 
							  'unknown' => 'Actions-Logical.jpg', 'trigger' => 'Editor-Trigger.jpg', 'events' => 'Editor-TriggerEvent.jpg'
							  );
			$indentPics     = array('line.jpg', "joinbottom.jpg", 'join.jpg', 'empty.jpg');
			$indHtmlStart	= '<img class="inlineimg" alt="    " src="';
			$indHtmlEnd		= '" />';
			$highlight      = '@';
			$highlightStyle = 'background-color: yellow;';
			$htmlStart 		= '<img class="inlineimg" style="margin-right:5px;" alt="" src="';
			$htmlEnd		= '" />';
		// ----- End of Configurations
		
		$final		  = "";
		$tempStr      = "";
		$levels       = array();
		$hasBeenSeen  = array();
		$indentations = array();
		$lines        = explode("\n", $content);
		$lineCount    = count($lines);
		$prevWasEvent = false;
		$offset = 1000;
		
		// Removing the spaces and finding out the smallest level.
		for($i = 0; $i < $lineCount; $i++) {
			while (preg_match('/^@* {4}/', $lines[$i])) {
				$lines[$i] = preg_replace('/ {4}/', '', $lines[$i], 1);
				$levels[$i]++;
			}
			/*if (!isset($offset) AND $lines[$i] != "" AND $lines[$i] != NULL)
				$offset = $levels[$i];
			else*/
				if ($levels[$i] < $offset)
					$offset = $levels[$i];
		}
		
		// Now when the offset has been found out, let's fix the levels.
		for($i = 0; $i < $lineCount; $i++)
			$levels[$i] -= $offset;
		
		// Adding all the images and stuff.
		for($i = $lineCount - 1; $i >= 0; $i--) {
			$indentation = "";
			
			// Reset hasBeenSeen
			for($j = $levels[$i + 1] + 1; $j < $levels[$i]; $j++)
				$hasBeenSeen[$j] = false;
			
			// Setting the ones on the left
			for($j = 1; $j < $levels[$i]; $j++)
				if ($hasBeenSeen[$j])
					$indentation .= $indHtmlStart . $path . $indentPics[0] . $indHtmlEnd; // |
				else
					$indentation .= $indHtmlStart . $path . $indentPics[3] . $indHtmlEnd; // {empty}
			
			// Setting the image before the genre img.
			if ($levels[$i] > $levels[$i + 1]) {
				$indentation .= $indHtmlStart . $path . $indentPics[1] . $indHtmlEnd; // '-
				$hasBeenSeen[$levels[$i]] = true;
				
			} elseif ($levels[$i] == $levels[$i + 1] AND $levels[$i] != 0)
				$indentation .= $indHtmlStart . $path . $indentPics[2] . $indHtmlEnd; // |-
				
			elseif ($levels[$i] < $levels[$i + 1] AND $levels[$i] != 0)
				if ($hasBeenSeen[$levels[$i]])
					$indentation .= $indHtmlStart . $path . $indentPics[2] . $indHtmlEnd; // |-
				else {
					$indentation .= $indHtmlStart . $path . $indentPics[1] . $indHtmlEnd; // '-
					$hasBeenSeen[$levels[$i]] = true;
				}
				
			
			// Add the genre pic
			$wasFound = false;
			
			// If it should be the trigger name.
			if ($prevWasEvent) {
				$lines[$i] = $htmlStart . $path . $images['trigger'] .'" title="Trigger"'. $htmlEnd . $lines[$i];
				$prevWasEvent = false;
				$indentation = "";
			} elseif (preg_match('/^'. $highlight .'*Events/', $lines[$i])) {
				$lines[$i] = $htmlStart . $path . $images['events'] .'" title="Events"'. $htmlEnd . $lines[$i];
				$prevWasEvent = true;
			} else {
				for($j = 0; $j < count($images) - 3 AND !$wasFound; $j++) // There's 3 images that are not got with integers
					if (preg_match('/^'. $highlight .'*'. $keywords[$j] .'/', $lines[$i])) {
						$wasFound = true;
						$lines[$i] = $htmlStart . $path . $images[$j] .'" title="'. $keywords[$j] .'"'. $htmlEnd . $lines[$i];
					}
				if (!$wasFound)
					$lines[$i] = $htmlStart . $path . $images['unknown'] .'" title="Unknown"'. $htmlEnd . $lines[$i];
			}
			
			// Add to $final.
			$final = $indentation . $lines[$i] . "\n" . $final;
		}
		
		// $highlight isn't there for nothing!
		$inHigh = false;
		$temp = preg_split("/(". $highlight .")/", $final, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
		$final = "";
		
		// Two options for the highlighting.
		foreach($temp as $part)
			if ($part == $highlight) {
				if ($inHigh)
					$final .= '</span>';
				else
					$final .= '<span style="'. $highlightStyle .'">';
				$inHigh = !$inHigh;
			} else
				$final .= $part;
		
		return trim($final);
	}

For all I care, that code may be used freely for any purposes.

And these should be the images used for it: http://www.mediafire.com/?jherz20mkmt
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
You could ask TriggerHappy. A while ago, playdota.com needed Jass tags for its programming section. After asking tons of people and being redirected to each other. Finally, I was redirected to TriggerHappy who gave me his vBulletin plugin for Jass. You could for sure extract the code from it.

I'm not sure if he's still on these forums. You could try to catch him on other wc3 related websites.
 

dorbian

New Member
Reaction score
1
thanks :) i'm currently trying the code, doubt however that i'll use any code coloring for my blog, only for my snippet library.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top