找回密码
 点一下
查看: 3673|回复: 15

【测试】完美的JASS高亮 + 支持 函数ONLINE查找帮助

[复制链接]
发表于 2006-4-4 11:25:23 | 显示全部楼层 |阅读模式


如果以下JASS TAG的底部 "Parsed in 0.xxx seconds" 不为0.000便说明可以用
[jass]
function Chr takes integer i returns string
    if i == 0 then
        return null
    elseif i >= 8 and i <= 10 then
        return SubString("btn", i - 8, i - 7)
    elseif i >= 12 and i <= 13 then
        return SubString("fr", i - 12, i - 11)
    elseif i >= 32 and i <= 127 then
        return SubString(" !\"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", i - 32, i - 31)
    endif
    return ""
endfunction
[/jass]

[ 本帖最后由 greedwind 于 2006-4-5 00:11 编辑 ]
发表于 2006-4-4 12:16:05 | 显示全部楼层
[jass]
function InitByteData_Sample takes nothing returns string
    return \"........\\b\\t\\n.\\f\\r.................. !\\\"#$%%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~一丁?七???万丈三上下丌不与?丐丑?专且丕世?丘丙业丛东丝丞???丢?两严?丧丨?个丫丬中??丰?串?临?丶?丸丹为主?丽举丿1212±÷āō12ǔ12?12?1212ΩπЖю1212121212121212121212121212123123※々一倍怀火耀退123123123123123?1234123412341234123412341234123412345123451234512345123456123456..\"
endfunction
[/jass]
回复

使用道具 举报

 楼主| 发表于 2006-4-4 12:19:28 | 显示全部楼层
[php]
<?php

if(!defined(\'IN_DISCUZ\')) {
        exit(\'Access Denied\');
}

define(\'DISCUZ_VERSION\', \'4.1.0\');
define(\'DISCUZ_RELEASE\', \'20060303\');

?>
[/php]
回复

使用道具 举报

发表于 2006-4-4 12:22:59 | 显示全部楼层
测试???
[jass]function DeleteColor takes string s returns string
    local string  chHex = \"0123456789ABCDEFabcdef\"
    local integer cbSrc = StringLength(s)
    local string  sRet = \"\"
    local string  byCur
    local integer iPos
    local integer iTemp
    local integer I
   
    // Main
    if cbSrc > 0 then
        set I = 0
        loop
            set iPos = InStr(s, \"|\", I)
            exitwhen -1 == iPos // can\'t find
            exitwhen iPos + 1 >= cbSrc // \"|\" in end
            set sRet = sRet + SubString(s, I, iPos)
            set byCur = SubString(s, iPos + 1, iPos + 2)
            if (\"C\" == byCur) or (\"c\" == byCur) then
                set iTemp = ScanByte(s, chHex, iPos + 2)
                if iTemp >= iPos + 10 then
                    set I = iPos + 10
                else
                    set sRet = sRet + SubString(s, iPos, iTemp)
                    set I = iTemp
                endif
            else
                if (\"R\" == byCur) or (\"r\" == byCur) then
                else
                    set sRet = sRet + SubString(s, iPos, iPos + 2)
                endif
                set I = iPos + 2
            endif
        endloop
        set sRet = sRet + SubString(s, I, cbSrc)
    endif  
    return sRet
endfunction[/jass]
回复

使用道具 举报

 楼主| 发表于 2006-4-4 12:40:29 | 显示全部楼层
晕死,这个版本的PHP不支持3000多元素定义???

我在我的机器做好了啊
回复

使用道具 举报

发表于 2006-4-4 12:47:24 | 显示全部楼层
mei xiaoguo a !5555
回复

使用道具 举报

 楼主| 发表于 2006-4-4 13:21:23 | 显示全部楼层
看3楼的PHP都可以,证明是PHP版本问题
回复

使用道具 举报

发表于 2006-4-4 13:21:49 | 显示全部楼层
555555555果然无效果。
回复

使用道具 举报

发表于 2006-4-4 13:29:18 | 显示全部楼层
[php]<?php

define(\'CURSCRIPT\', \'seccode\');

require_once \'./include/common.inc.php\';

if($seccode < 1 || $seccode > 9999) {
        exit(\'Access Denied\');
}

$seccode = sprintf(\'%04d\', $seccode);

if(!$nocacheheaders) {
        @header(\"Expires: 0\");
        @header(\"Cache-Control: private, post-check=0, pre-check=0, max-age=0\", FALSE);
        @header(\"Pragma: no-cache\");
}

if(function_exists(\'imagecreate\') && function_exists(\'imagecolorallocate\') && function_exists(\'imagesetpixel\') && function_exists(\'imagechar\') && function_exists(\'imagepng\')) {

        $im = imagecreate(62, 25);
        $background_color = imagecolorallocate ($im, 200, 200, 200);

        for ($i=0; $i <= 128; $i++) {
                $point_color = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
                imagesetpixel($im, mt_rand(0, 62), mt_rand(0, 25), $point_color);
        }

        for($i = 0; $i < 4; $i++) {
                $text_color = imagecolorallocate($im, mt_rand(0,255), mt_rand(0,128), mt_rand(0,255));
                $x = 5 + $i * 15;
                $y = mt_rand(0, 10);
                imagechar($im, 5, $x, $y,  $seccode[$i], $text_color);
        }

        header(\'Content-type: image/png\');
        imagepng($im);
        imagedestroy($im);

} else {

        $numbers = array
                (
                0 => array(\'3c\',\'66\',\'66\',\'66\',\'66\',\'66\',\'66\',\'66\',\'66\',\'3c\'),
                1 => array(\'1c\',\'0c\',\'0c\',\'0c\',\'0c\',\'0c\',\'0c\',\'0c\',\'1c\',\'0c\'),
                2 => array(\'7e\',\'60\',\'60\',\'30\',\'18\',\'0c\',\'06\',\'06\',\'66\',\'3c\'),
                3 => array(\'3c\',\'66\',\'06\',\'06\',\'06\',\'1c\',\'06\',\'06\',\'66\',\'3c\'),
                4 => array(\'1e\',\'0c\',\'7e\',\'4c\',\'2c\',\'2c\',\'1c\',\'1c\',\'0c\',\'0c\'),
                5 => array(\'3c\',\'66\',\'06\',\'06\',\'06\',\'7c\',\'60\',\'60\',\'60\',\'7e\'),
                6 => array(\'3c\',\'66\',\'66\',\'66\',\'66\',\'7c\',\'60\',\'60\',\'30\',\'1c\'),
                7 => array(\'30\',\'30\',\'18\',\'18\',\'0c\',\'0c\',\'06\',\'06\',\'66\',\'7e\'),
                8 => array(\'3c\',\'66\',\'66\',\'66\',\'66\',\'3c\',\'66\',\'66\',\'66\',\'3c\'),
                9 => array(\'38\',\'0c\',\'06\',\'06\',\'3e\',\'66\',\'66\',\'66\',\'66\',\'3c\')
                );

        for($i = 0; $i < 10; $i++) {
                for($j = 0; $j < 6; $j++) {
                        $a1 = substr(\'012\', mt_rand(0, 2), 1).substr(\'012345\', mt_rand(0, 5), 1);
                        $a2 = substr(\'012345\', mt_rand(0, 5), 1).substr(\'0123\', mt_rand(0, 3), 1);
                        mt_rand(0, 1) == 1 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a1);
                        mt_rand(0, 1) == 0 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a2);
                }
        }

        $bitmap = array();
        for($i = 0; $i < 20; $i++) {
                for ($j = 0; $j < 4; $j++) {
                        $n = substr($seccode, $j, 1);
                        $bytes = $numbers[$n][$i];
                        $a = mt_rand(0, 14);
                        switch($a) {
                                case 1: str_replace(\'9\', \'8\', $bytes); break;
                                case 3: str_replace(\'c\', \'e\', $bytes); break;
                                case 6: str_replace(\'3\', \'b\', $bytes); break;
                                case 8: str_replace(\'8\', \'9\', $bytes); break;
                                case 0: str_replace(\'e\', \'f\', $bytes); break;
                        }
                        array_push($bitmap, $bytes);
                }
        }

        for ($i = 0; $i < 8; $i++) {
                $a = substr(\'012\', mt_rand(0, 2), 1) . substr(\'012345\', mt_rand(0, 5), 1);
                array_unshift($bitmap, $a);
                array_push($bitmap, $a);
        }

        $image = pack(\'H*\', \'424d9e000000000000003e000000280000002000000018000000010001000000\'.
                        \'0000600000000000000000000000000000000000000000000000FFFFFF00\'.implode(\'\', $bitmap));

        header(\'Content-Type: image/bmp\');
        echo $image;

}

?>[/php]
回复

使用道具 举报

发表于 2006-4-4 13:31:22 | 显示全部楼层
[jass]
<?php

        if(!$thread = $db->fetch_array($query)) }

?>
[/jass]
回复

使用道具 举报

 楼主| 发表于 2006-4-4 13:51:10 | 显示全部楼层
呵呵,你用的TAG用错了,没看我的程序。
笨笨笨,
笨死了。

php的语法关键字有几个和JASS相同的?还用JASS tag;P;P;P;P;P;P;P;P;P;P;P

[ 本帖最后由 greedwind 于 2006-4-4 13:52 编辑 ]
回复

使用道具 举报

发表于 2006-4-4 14:36:16 | 显示全部楼层
没有错的 我在试是否是因为之前有修改过其他的 之前不是给我个关于高亮的吗  而且我从WC3C摘取了一些 我试着修改过
回复

使用道具 举报

发表于 2006-4-4 15:19:15 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| 发表于 2006-4-6 21:21:02 | 显示全部楼层
可以正常显示了
回复

使用道具 举报

发表于 2006-4-6 21:45:12 | 显示全部楼层
字符串判断存在小问题:碰到 \\\" 字符串转义符时,认为字符串数据结束了
回复

使用道具 举报

 楼主| 发表于 2006-4-6 22:00:29 | 显示全部楼层
原帖由 zyl910 于 2006-4-6 21:45 发表
字符串判断存在小问题:碰到 \\\" 字符串转义符时,认为字符串数据结束了

这个等geshi系统修改了,这系统不是我做的,我只是移植而已。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-2 04:11 , Processed in 0.103265 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表