UoKit.com _ UO Pilot _ | .

: FREEON 27.1.2019, 10:52

?
test.txt, , ( ).

1,2,3,4,5,11,27

1 , 2 . .
, :
qwerty : Hfcrkflrf ->

. , , . .
:
$GfHjKm$_Dfvgbh >>> ;;_


--lua
--
-- Hfcrkflrf ->
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["a"]=""  t["b"]=""  t["c"]=""  t["d"]=""  t["e"]=""  t["f"]=""
t["g"]=""  t["h"]=""  t["i"]=""  t["j"]=""  t["k"]=""  t["l"]=""
t["m"]=""  t["n"]=""  t["o"]=""  t["p"]=""  t["q"]=""  t["r"]=""
t["s"]=""  t["t"]=""  t["u"]=""  t["v"]=""  t["w"]=""  t["x"]=""
t["y"]=""  t["z"]=""  t["`"]=""  t["["]=""  t["]"]=""  t[";"]=""
t["'"]=""  t[","]=""  t["."]=""  t["/"]="."  t["A"]=""  t["B"]=""
t["C"]=""  t["D"]=""  t["E"]=""  t["F"]=""  t["G"]=""  t["H"]=""
t["I"]=""  t["J"]=""  t["K"]=""  t["L"]=""  t["M"]=""  t["N"]=""
t["O"]=""  t["P"]=""  t["Q"]=""  t["R"]=""  t["S"]=""  t["T"]=""
t["U"]=""  t["V"]=""  t["W"]=""  t["X"]=""  t["Y"]=""  t["Z"]=""
t["{"]=""  t["}"]=""  t[":"]=""  t['"']=""  t["<"]=""  t[">"]=""
t["?"]=","  t["~"]=""  t["@"]='"'  t["#"]=""  t["$"]=";"  t["^"]=":"
t["&"]="?"

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end

URL-decoder(): %D0%A2%D0%B5%D0%BA%D1%81%D1%82 ->

URL () . URL US-ASCII. , , . . , , , .
:
%D0%9A%D1%83%D0%BF%D0%B8%D1%82%D1%8C >>>


--lua
log "clear"   log "mode compact"

local s=" URL"   -- << url- ""
log(s)

local t={}
t["%D0%90"]="" t["%D0%91"]="" t["%D0%92"]="" t["%D0%93"]="" t["%D0%94"]="" t["%D0%95"]="" t["%D0%81"]="" t["%D0%96"]="" t["%D0%97"]="" t["%D0%98"]="" t["%D0%99"]=""
t["%D0%9A"]="" t["%D0%9B"]="" t["%D0%9C"]="" t["%D0%9D"]="" t["%D0%9E"]="" t["%D0%9F"]="" t["%D0%A0"]="" t["%D0%A1"]="" t["%D0%A2"]="" t["%D0%A3"]="" t["%D0%A4"]=""
t["%D0%A5"]="" t["%D0%A6"]="" t["%D0%A7"]="" t["%D0%A8"]="" t["%D0%A9"]="" t["%D0%AA"]="" t["%D0%AB"]="" t["%D0%AC"]="" t["%D0%AD"]="" t["%D0%AE"]="" t["%D0%AF"]=""
t["%D0%B0"]="" t["%D0%B1"]="" t["%D0%B2"]="" t["%D0%B3"]="" t["%D0%B4"]="" t["%D0%B5"]="" t["%D1%91"]="" t["%D0%B6"]="" t["%D0%B7"]="" t["%D0%B8"]="" t["%D0%B9"]=""
t["%D0%BA"]="" t["%D0%BB"]="" t["%D0%BC"]="" t["%D0%BD"]="" t["%D0%BE"]="" t["%D0%BF"]="" t["%D1%80"]="" t["%D1%81"]="" t["%D1%82"]="" t["%D1%83"]="" t["%D1%84"]=""
t["%D1%85"]="" t["%D1%86"]="" t["%D1%87"]="" t["%D1%88"]="" t["%D1%89"]="" t["%D1%8A"]="" t["%D1%8B"]="" t["%D1%8C"]="" t["%D1%8D"]="" t["%D1%8E"]="" t["%D1%8F"]=""

for v in pairs(t) do   -- , "%D0%9A", "%d0%9a"
    t[v:lower()]=t[v]
end

for i=32, 127 do t["%" .. string.format("%X", i)]=string.char(i) end   -- , ascii 32 127

s=s:gsub("%%[Dd][01]%%%x%x", t)   --
s=s:gsub("%%..", t)               --
log(s)                            --

. Reverser : . -> .

, , . ... smile.gif
.
:
! >>> !


--lua
log "clear"  log "mode compact"
local s=" ."
log (s)
log (s:reverse())

: Morse to text -> -- --- .-. ... . - --- - . -..- -

, , , , .
. :
Text <<->> - . -..- -


--lua
log "clear"  log "mode compact"
-- () .
local text=[[Text or - . -..- -]]-- << .

log(text)

local t, t1, temp = {}, {}, {}
t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."   t["G"]="--."
t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"     t["N"]="-."
t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"      t["U"]="..-"
t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%- ]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub((text .. " "):gsub("(.-) ", t1), "  ", " ")    --
else
    text=string.gsub(text:gsub("(.)", "%1 "), "[^ ]", t)  --
end
log (text)

. :
<<->> - . -.- ... -


--lua
log "clear"  log "mode compact"

-- () .
local text=[[ - . -.- ... -]]-- << .

log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.." t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"    t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-" t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%- ]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub((text .. " "):gsub("(.-) ", t1), "  ", " ")    --
else
    text=string.gsub(text:gsub("(.)", "%1 "), "[^ ]", t)  --
end
log (text)


https://forum.uokit.com/index.php?showuser=16971.

: cirus 27.1.2019, 11:44

--lua
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["1"]=""          -- '1' ''
t["2"]=""          -- '2' ''
t["11"]=" "

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, "[^,]+", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end

: NoName212 27.1.2019, 12:24

php )



3.0(2012 ! :/ ) , (). , , , , - , . F5. test.txt, . 0 => 'string' .

c("label1")->text;
$find_and_repeat = array (
'0' => '',
'1' => ' ',
'23' => ' ',
'45' => ' ',
);
$test = 'test.txt';
$test = file_get_contents($test);
$test = explode (',', $test); // , - !
foreach ($find_and_repeat as $key => $v)
{
    $test = str_replace($key, $v, $test);
    $newTest = fopen('new_test.txt', 'w');
    $check = fwrite($newTest , implode($test));
    fclose($newTest);
}
//print_r($test);
if($check = true)
{echo '!!!';}

: FREEON 27.1.2019, 13:12

(cirus @ 27.1.2019, 11:44) *

--lua
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["1"]=""          -- '1' ''
t["2"]=""          -- '2' ''
t["11"]=" "

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, "[^,]+", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end


, qwerty - q =
:
.- =
-... =
.-- =

: DarkMaster 27.1.2019, 13:28

, qwerty - q =

:
t["1"]="" -- '1' ''
t["2"]="" -- '2' ''
t["11"]=" "


: cirus 27.1.2019, 13:38

:

, . , .
qwerty

--lua
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["q"]=""          -- 'q' ''
t["w"]=""          
t["e"]=""
t["r-"]=""

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end

:

. ?
.- = - 2
-... = - 4
.--... - , .--
1 .

: FREEON 27.1.2019, 13:43

(DarkMaster @ 27.1.2019, 13:28) *

:


t["q"]=""          -- ''
t["w."]=""          -- '2' ''
t["e"]=""
t["t"]=""
t["y"]=""

:

qwetty
qwerrrty q
ytreq
ytrewq

:

qwetty
qwerrrty q
ytreq
ytrewq
huh.gif

(cirus @ 27.1.2019, 13:38) *

, . , .

.gsub(v, ".", t).."\r\n")  --       't'


? ? ?

: cirus 27.1.2019, 14:04

.gsub(v, ".", t).."\r\n")
?

, , .
?

. 'lua '.

"." - , , "..." - 3
"[^,]+" - , 1

: FREEON 27.1.2019, 14:31

(cirus @ 27.1.2019, 13:38) *

. ?
.- = - 2
-... = - 4
.--... - , .--
1 .

, .

, , !



-- , : "" 1
"" ( )
: 0
, ,

php


<?php
/**
* Created by PhpStorm.
* User: karamush
* Date: 13.07.2018
* Time: 23:08
*/

class MorseCoder_Class {

    public $MORSE_CHAR_DELIMITER = ' ';            //
    public $UNKNOWN_CHAR = '?';                    // .
    public $MORSE_DOT = '.';                       //
    public $MORSE_DASH = '-';                      //
    public $MORSE_BIN_DOT = '1';                   //
    public $MORSE_BIN_DASH ='111';                 //
    public $MORSE_BIN_DELIMITER = '0';             //
    public $MORSE_BIN_CHAR_DELIMITER = '00';       //
    public $MORSE_BIN_WORD_DELIMITER = '000';      // (. ?)

    const MORSE_TYPE_SIMPLE = 0;
    const MORSE_TYPE_BINARY = 1;
    const MORSE_LANGUAGE_LATIN = 1;
    const MORSE_LANGUAGE_CYRILLIC = 0;

    public $morse_type = self::MORSE_TYPE_BINARY;
    public $morse_language = self::MORSE_LANGUAGE_CYRILLIC;
    public $morse_capital = true;

    //
    private $codes_symbols = [
        '1' => '.----',
        '2' => '..---',
        '3' => '...--',
        '4' => '....-',
        '5' => '.....',
        '6' => '-....',
        '7' => '--...',
        '8' => '---..',
        '9' => '----.',
        '0' => '-----',
        '.' => '......',
        ',' => '.-.-.-',
        ':' => '---...',
        ';' => '-.-.-.',
        '(' => '-.--.-',
        ')' => '-.--..', // TODO: . :)
        '\'' => '.----.',
        '`' => '.----.',
        '"' => '.-..-.',
        '-' => '-....-',
        '/' => '-..-.',
        '?' => '..--..',
        '!' => '--..--',
        ' ' => '-...-', // , , , WTF?!
        "\n" => '-.-..',    // TODO: . !
        "\r" => '-.-..-',   // TODO: --!
        '@' => '.--.-.',
        '[END]' => '..-.-'
    ];

    //
    private $codes_latin = [
        'A' => '.-',
        'B' => '-...',
        'C' => '-.-.',
        'D' => '-..',
        'E' => '.',
        'F' => '..-.',
        'G' => '--.',
        'H' => '....',
        'I' => '..',
        'J' => '.---',
        'K' => '-.-',
        'L' => '.-..',
        'M' => '--',
        'N' => '-.',
        'O' => '---',
        'P' => '.--.',
        'Q' => '--.-',
        'R' => '.-.',
        'S' => '...',
        'T' => '-',
        'U' => '..-',
        'W' => '.--',
        'X' => '-..-',
        'Y' => '-.--',
        'Z' => '--..',
        'V' => '...-',
        'CH' => '---.',
        'SH' => '----',
        'Ñ' => '-..-',
        'É' => '..-..',
        'Ü' => '..--',
        'Ä' => '.-.-'
    ];

    //
    private $codes_cyrillic = [
        '' => '.-',
        '' => '-...',
        '' => '.--',
        '' => '--.',
        '' => '-..',
        '' => '.',     '' => '.',
        '' => '...-',
        '' => '--..',
        '' => '..',
        '' => '.---',
        '' => '-.-',
        '' => '.-..',
        '' => '--',
        '' => '-.',
        '' => '---',
        '' => '.--.',
        '' => '.-.',
        '' => '...',
        '' => '-',
        '' => '..-',
        '' => '..-.',
        '' => '....',
        '' => '-.-.',
        '' => '---.',
        '' => '----',
        '' => '--.-',
        '' => '-..-',  '' => '-..-',
        '' => '-.--',
        '' => '..-..',
        '' => '..--',
        '' => '.-.-',
    ];

    public function __construct() {

    }

    /**
     * , ,
     * ,
     * . .
     *
     * @return array
     */
    private function get_current_full_alphabet() {
        $alphabet = ($this->morse_language == self::MORSE_LANGUAGE_CYRILLIC) ? array_merge($this->codes_cyrillic, $this->codes_latin) : array_merge($this->codes_latin, $this->codes_cyrillic);
        return array_merge($alphabet, $this->codes_symbols);
    }

    /**
     * -
     * @param $char
     *
     * @return mixed|string
     */
    function char_to_morse($char) {
        $char = mb_strtoupper($char);
        return array_key_exists($char, $this->get_current_full_alphabet()) ? $this->get_current_full_alphabet()[$char] : $this->UNKNOWN_CHAR;
    }

    /**
     * , ..
     * @param $morse_text
     *
     * @return string
     */
    function prepare_morse_text($morse_text) {
        $morse_text = str_replace('*', '.', $morse_text);
        $morse_text = str_replace('_', '-', $morse_text);
        return $morse_text;
    }

    function mbStringToArray($string, $encoding = 'UTF-8') {
        $strlen = mb_strlen($string);
        $str_array = [];
        while ($strlen) {
            $str_array[] = mb_substr($string, 0, 1, $encoding);
            $string = mb_substr($string, 1, $strlen, $encoding);
            $strlen = mb_strlen($string, $encoding);
        }
        return $str_array;
    }

    /**
     * -
     * @param $morse_char
     *
     * @return string
     */
    function morse_to_char($morse_char) {
        //
        $morse_char = $this->prepare_morse_text($morse_char);
        return in_array($morse_char, $this->get_current_full_alphabet()) ? array_search($morse_char, $this->get_current_full_alphabet()) : $this->UNKNOWN_CHAR;
    }

    /**
     * , .
     * @param $plain_text
     *
     * @return string
     */
    function text_to_morse($plain_text) {
        $plain_text = $this->mbStringToArray(mb_strtoupper($plain_text));
        $result = '';
        foreach ($plain_text as $char) {
            $result .= $this->char_to_morse($char) . $this->MORSE_CHAR_DELIMITER;
        }
        return $result;
    }

    /**
     * .
     *
     * @param      $morse_text
     *
     * @return string
     */
    function morse_to_text($morse_text) {
        $morse_chars = explode($this->MORSE_CHAR_DELIMITER, $morse_text);
        $result = '';
        foreach($morse_chars as $char) {
            $result .= $this->morse_to_char($char);
        }

        return $this->morse_capital ? $result : mb_strtolower($result);
    }

    /**
     * .
     * @param $morse_bin_text
     *
     * @return string
     */
    function morse_bin_to_morse($morse_bin_text) {
        $result = '';
        $bin_morse_chars = explode($this->MORSE_BIN_CHAR_DELIMITER, $morse_bin_text);
        foreach ($bin_morse_chars as $bin_morse_char) {
            $bin_morse_char = str_replace($this->MORSE_BIN_DASH, $this->MORSE_DASH, $bin_morse_char);
            $bin_morse_char = str_replace($this->MORSE_BIN_DOT, $this->MORSE_DOT, $bin_morse_char);
            $bin_morse_char = str_replace($this->MORSE_BIN_DELIMITER, '', $bin_morse_char);
            $result .= $bin_morse_char . $this->MORSE_CHAR_DELIMITER;
        }
        return rtrim($result, $this->MORSE_CHAR_DELIMITER);
    }

    /**
     * .
     * @param $morse_text
     *
     * @return string
     */
    function morse_to_morse_bin($morse_text) {
        $result = '';
        $morse_text = $this->prepare_morse_text($morse_text);
        for($i=0; $i<strlen($morse_text);$i++) {
            switch ($morse_text[$i]) {
                case $this->MORSE_DOT: $result .= $this->MORSE_BIN_DOT . $this->MORSE_BIN_DELIMITER; break;
                case $this->MORSE_DASH: $result .= $this->MORSE_BIN_DASH . $this->MORSE_BIN_DELIMITER; break;
                case $this->MORSE_CHAR_DELIMITER: $result .= $this->MORSE_BIN_DELIMITER; break; // , .
            }
        }
        return $result;
    }

    /**
     *
     * @param $plaint_text
     *
     * @return string
     */
    function text_to_morse_bin($plaint_text) {
        return $this->morse_to_morse_bin($this->text_to_morse($plaint_text));
    }

    /**
     *
     *
     * @param      $morse_bin
     *
     * @return string
     */
    function morse_bin_to_text($morse_bin) {
        return $this->morse_to_text($this->morse_bin_to_morse($morse_bin));
    }

    /**
     *
     * ( morse_type)
     * @param $plain_text
     *
     * @return string
     */
    function morse_encode($plain_text) {
        return ($this->morse_type == self::MORSE_TYPE_BINARY) ? $this->text_to_morse_bin($plain_text) : $this->text_to_morse($plain_text);
    }

    /**
     *
     * ( morse_type)
     * @param $encoded_text
     *
     * @return string
     */
    function morse_decode($encoded_text) {
        return ($this->morse_type == self::MORSE_TYPE_BINARY) ? $this->morse_bin_to_text($encoded_text) : $this->morse_to_text($encoded_text);
    }


}


: FREEON 27.1.2019, 16:18

... ( )? ( ).

: cirus 27.1.2019, 16:25

--lua
log "clear"  log "mode compact"
local t={}  --
t[".-"]="A"
t["-..."]="B"
t["-.-."]="C"

local x="ACDBA"   -- , 'D' ,
log(" :\r\n" .. x)
log()

-- :
--    A           B             C               --
--    .-00        -...00        -.-.00          -- 00
--    .0-00       -0.0.0.00     -0.0-0.00       -- 0
--    10-00       -01010100     -010-0100       -- 1
--    1011100     11101010100   1110101110100   -- 111

local s=""
for w in x:gmatch(".") do         --
    local break_=0
    for i, value in pairs(t) do   --
        if value == w then        --
            s=s .. string.gsub(string.gsub(string.gsub(i, "(.)", "%10") .. "0", "%.", "1"), "%-", "111")  -- , 'A' 1011100
            break_ = 1    --
            break
        end
    end
    if break_ == 0 then s=s .. w .. "00" end   -- , , . .
end
log (" :\r\n" .. s)   --
log()

local ss=""
for w in s:gmatch("(.-)00") do  -- , 00
    if w:match("[01]+") then    --
       ss=ss .. string.gsub(string.gsub(string.gsub(w:gsub("111", "-"), "1", "."), "0", ""), ".+", t)
    else
       ss=ss .. w   -- ,
    end
end
log (" :\r\n" .. ss)

( )? ( ).

. http://uopilot.tati.pro/index.php?title=Clipboard_(Lua)

: FREEON 27.1.2019, 17:44

(cirus @ 27.1.2019, 16:25) *

--lua
log "clear"  log "mode compact"
local t={}  --
t[".-"]="A"
t["-..."]="B"
t["-.-."]="C"

local x="ACDBA"   -- , 'D' ,
log(" :\r\n" .. x)
log()

-- :
--    A           B             C               --
--    .-00        -...00        -.-.00          -- 00
--    .0-00       -0.0.0.00     -0.0-0.00       -- 0
--    10-00       -01010100     -010-0100       -- 1
--    1011100     11101010100   1110101110100   -- 111

local s=""
for w in x:gmatch(".") do         --
    local break_=0
    for i, value in pairs(t) do   --
        if value == w then        --
            s=s .. string.gsub(string.gsub(string.gsub(i, "(.)", "%10") .. "0", "%.", "1"), "%-", "111")  -- , 'A' 1011100
            break_ = 1    --
            break
        end
    end
    if break_ == 0 then s=s .. w .. "00" end   -- , , . .
end
log (" :\r\n" .. s)   --
log()

local ss=""
for w in s:gmatch("(.-)00") do  -- , 00
    if w:match("[01]+") then    --
       ss=ss .. string.gsub(string.gsub(string.gsub(w:gsub("111", "-"), "1", "."), "0", ""), ".+", t)
    else
       ss=ss .. w   -- ,
    end
end
log (" :\r\n" .. ss)


. http://uopilot.tati.pro/index.php?title=Clipboard_(Lua)

, , - biggrin.gif
laugh.gif

t[".-"]="A"
t["-..."]="B"
t["-.-."]="C"
t["-.."]="D"
t["."]= "E"
t["..-."]="F"
t["--."]="G"
t["...."]="H"
t[".."]="I"
t[".---"]="J"
t["-.-"]="K"
t[".-.."]="L"
t["--"]="M"
t["-."]="N"
t["---"]="O"
t[".--."]="P"
t["--.-"]="Q"
t[".-."]="R"
t["..."]="S"
t["-"]="T"
t["..-"]="U"
t[".--"]="W"
t["-..-"]="X"
t["-.--"]="Y"
t["--.."]="Z"


:
ACZBA
:
101110011101011101001110111010100111010101001011100
:
ACZBA
, -.

: cirus 27.1.2019, 18:26

-.

.

: FREEON 27.1.2019, 18:40

(cirus @ 27.1.2019, 18:26) *

.

, A:
:
.-
:
.00-00
:
.- ( )
2 C, :
:
C
:
1110101110100
:
C ( -.-. ?)
sad.gif

: cirus 27.1.2019, 19:14

, A:
:
.-

, 'A' '1011100' '1011100' 'A'.
:
--

? , .
: '.-.-...-..-..-.' , . .

: FREEON 27.1.2019, 20:10

, ? ?


--t["""]=""
--t["@"]="""

Hfcrkflrf ->


--lua
--
-- Hfcrkflrf ->
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["a"]=""          -- 'a' ''
t["b"]=""
t["c"]=""
t["d"]=""
t["e"]=""
t["f"]=""
t["g"]=""
t["h"]=""
t["i"]=""
t["j"]=""
t["k"]=""
t["l"]=""
t["m"]=""
t["n"]=""
t["o"]=""
t["p"]=""
t["q"]=""
t["r"]=""
t["s"]=""
t["t"]=""
t["u"]=""
t["v"]=""
t["w"]=""
t["x"]=""
t["y"]=""
t["z"]=""
t["`"]=""
t["["]=""
t["]"]=""
t[";"]=""
t["'"]=""
t[","]=""
t["."]=""
t["/"]="."
t["A"]=""
t["B"]=""
t["C"]=""
t["D"]=""
t["E"]=""
t["F"]=""
t["G"]=""
t["H"]=""
t["I"]=""
t["J"]=""
t["K"]=""
t["L"]=""
t["M"]=""
t["N"]=""
t["O"]=""
t["P"]=""
t["Q"]=""
t["R"]=""
t["S"]=""
t["T"]=""
t["U"]=""
t["V"]=""
t["W"]=""
t["X"]=""
t["Y"]=""
t["Z"]=""
t["{"]=""
t["}"]=""
t[":"]=""
--t["""]=""
t["<"]=""
t[">"]=""
t["?"]=","
t["~"]=""
--t["@"]="""
t["#"]=""
t["$"]=";"
t["^"]=":"
t["&"]="?"

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end


: cirus 27.1.2019, 20:27

--lua
local s1 = '"Hello!"'        --
local s2 = "'Hello!'"        --
local s3 = [['"Hello!"']]    --
log (s1)
log (s2)
log (s3)

: cirus 27.1.2019, 21:02

t["<"]=""
t[">"]=""
t["?"]=","

1 .
t["<"]=""   t[">"]=""    t["?"]=","


: DarkMaster 27.1.2019, 21:08

local s3 = [['"Hello!"']] --

local s4 = [====['"Hello!"']====]
. . = , . .

: FREEON 28.1.2019, 1:16

url-... unsure.gif
6 3 ( ):
= %d0%93
= %d1%80
( ; : @ & = + $ , / ? % # [ ]) 3 , 1 , 2- d
= %20 =+
# = %23
{ = %7B
, %d0%af %D0%AF %d1%8f %D1%8F. ?
=> %D0%9A%D0%BE%D0%B4
%D0%9A+%D0%BE+%D0%B4
%D0%9A%20%D0%BE%20%D0%B4

: cirus 28.1.2019, 4:24

--lua
log "clear"   log "mode compact"

local s="%D0%9A%D0%BE%D0%B4%20%7Benglish%20text%7D%20%D0%9A%D0%BE%D0%B4%20lua!!!"   -- {english text} lua!!!
log(s)

local t={}
t["%D0%9A"]=""
t["%D0%BE"]=""
t["%D0%B4"]=""
-- ,
--

for v in pairs(t) do   -- , "%D0%9A", "%d0%9a"
    t[v:lower()]=t[v]
end

for i=32, 127 do t["%" .. string.format("%X", i)]=string.char(i) end   -- , ascii 32 127


s=s:gsub("%%[Dd][01]%%%x%x", t)   --
s=s:gsub("%%..", t)               --
log(s)                            --

: FREEON 28.1.2019, 6:38

(cirus @ 28.1.2019, 4:24) *

--lua
log "clear"   log "mode compact"

local s="%D0%9A%D0%BE%D0%B4%20%7Benglish%20text%7D%20%D0%9A%D0%BE%D0%B4%20lua!!!"   -- {english text} lua!!!
log(s)

local t={}
t["%D0%9A"]=""
t["%D0%BE"]=""
t["%D0%B4"]=""
-- ,
--

for v in pairs(t) do   -- , "%D0%9A", "%d0%9a"
    t[v:lower()]=t[v]
end

for i=32, 127 do t["%" .. string.format("%X", i)]=string.char(i) end   -- , ascii 32 127
s=s:gsub("%%[Dd][01]%%%x%x", t)   --
s=s:gsub("%%..", t)               --
log(s)                            --


- smile.gif
URL-: %D0%A2%D0%B5%D0%BA%D1%81%D1%82 ->


--lua
log "clear"   log "mode compact"

local s="Cirus-code-master%20%D0%B1%D0%BE%D0%B6%D1%8D%D0%BD%D1%8C%D0%BA%D0%B0!:)"   -- {english text} lua!!!
log(s)

local t={}
t["%D0%90"]="" t["%D0%91"]="" t["%D0%92"]="" t["%D0%93"]="" t["%D0%94"]="" t["%D0%95"]="" t["%D0%81"]="" t["%D0%96"]="" t["%D0%97"]="" t["%D0%98"]="" t["%D0%99"]=""
t["%D0%9A"]="" t["%D0%9B"]="" t["%D0%9C"]="" t["%D0%9D"]="" t["%D0%9E"]="" t["%D0%9F"]="" t["%D0%A0"]="" t["%D0%A1"]="" t["%D0%A2"]="" t["%D0%A3"]="" t["%D0%A4"]=""
t["%D0%A5"]="" t["%D0%A6"]="" t["%D0%A7"]="" t["%D0%A8"]="" t["%D0%A9"]="" t["%D0%AA"]="" t["%D0%AB"]="" t["%D0%AC"]="" t["%D0%AD"]="" t["%D0%AE"]="" t["%D0%AF"]=""
t["%D0%B0"]="" t["%D0%B1"]="" t["%D0%B2"]="" t["%D0%B3"]="" t["%D0%B4"]="" t["%D0%B5"]="" t["%D1%91"]="" t["%D0%B6"]="" t["%D0%B7"]="" t["%D0%B8"]="" t["%D0%B9"]=""
t["%D0%BA"]="" t["%D0%BB"]="" t["%D0%BC"]="" t["%D0%BD"]="" t["%D0%BE"]="" t["%D0%BF"]="" t["%D1%80"]="" t["%D1%81"]="" t["%D1%82"]="" t["%D1%83"]="" t["%D1%84"]=""
t["%D1%85"]="" t["%D1%86"]="" t["%D1%87"]="" t["%D1%88"]="" t["%D1%89"]="" t["%D1%8A"]="" t["%D1%8B"]="" t["%D1%8C"]="" t["%D1%8D"]="" t["%D1%8E"]="" t["%D1%8F"]=""

for v in pairs(t) do   -- , "%D0%9A", "%d0%9a"
    t[v:lower()]=t[v]
end

for i=32, 127 do t["%" .. string.format("%X", i)]=string.char(i) end   -- , ascii 32 127


s=s:gsub("%%[Dd][01]%%%x%x", t)   --
s=s:gsub("%%..", t)               --
log(s)                            --

: FREEON 28.1.2019, 14:39

? ? wink.gif
:

! >>> !

: cirus 28.1.2019, 15:27

?

--lua
log "clear"  log "mode compact"
local s=" !"
log (s:reverse())

http://uopilot.tati.pro/index.php?title=__(Lua)#.D0.A1.D1.82.D1.80.D0.BE.D0.BA.D0.B8

: FREEON 28.1.2019, 16:09

...


--lua
--log "clear"   log "mode compact"

--local s="-Text-123!"   -- , ""
--log(s)
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --
local t={}
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."
t["G"]="--."    t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"
t["N"]="-."     t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"
t["U"]="..-"    t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."   t[""]=".-"
t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."      t[""]="."      t[""]="...-"
t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"     t[""]="-."
t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"      t[""]="..-"    t[""]="..-."
t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"   t[""]="-..-"
t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do   -- , "%", "%"
    t[v:lower()]=t[v]
end

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end

--log(s)                            --

:
faer


.-- ..-..-..-.

, , ? huh.gif

: cirus 28.1.2019, 16:20

v:lower()

.
:
string_lower(v)

: FREEON 28.1.2019, 17:00

(cirus @ 28.1.2019, 16:20) *

.
:
string_lower(v)



--lua
log "clear"   log "mode compact"
local text = clipboard ()      -- text
log (text)                     -- text
wait (300)                 -- 300
local arr = clipboard (0, "string", "word") --
log()
local t={}
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."
t["G"]="--."    t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"
t["N"]="-."     t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"
t["U"]="..-"    t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."   t[""]=".-"
t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."      t[""]="."      t[""]="...-"
t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"     t[""]="-."
t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"      t[""]="..-"    t[""]="..-."
t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"   t[""]="-..-"
t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do   -- , "%", "%"
    t[string_lower(v)]=t[v]
end
--if --
    for v in file:lines() do
        s=s:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end
log(s)                            --
clipboard (???)                   --

... ... , ... lua ...

: cirus 28.1.2019, 17:11

--lua
log "clear"   log "mode compact"
local text = clipboard ()      -- text

wait (300)                     -- 300
log (text)                     -- text
log()
local t={}
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."
t["G"]="--."    t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"
t["N"]="-."     t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"
t["U"]="..-"    t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."   t[""]=".-"
t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."      t[""]="."      t[""]="...-"
t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"     t[""]="-."
t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"      t[""]="..-"    t[""]="..-."
t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"   t[""]="-..-"
t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do   -- , "%", "%"
    t[string_lower(v)]=t[v]
end

local s=text:gsub(".", t)
log(s)                          --
clipboard (s)                   --

: FREEON 28.1.2019, 20:51

... .
.
t["1"]=".----"

local s=text:gsub(".", t) --    

".---- " , , . ( )

: cirus 28.1.2019, 21:18

for v in pairs(t) do   --    ,   "",   ""

? ? 2 :
t[""]="-"
t[""]="-"

. . '-' 'T' ''. , , .

: FREEON 28.1.2019, 21:29

(cirus @ 28.1.2019, 21:18) *

for v in pairs(t) do   --    ,   "",   ""

? ? 2 :
t[""]="-"
t[""]="-"

. . '-' 'T' ''. , , .

, . . , "" , ( ). , ( ) ( ) .
(?) , . ,

: cirus 28.1.2019, 21:50

(?)

2 . , . .
1 , .

: FREEON 28.1.2019, 22:04

(cirus @ 28.1.2019, 21:50) *

2 . , . .
1 , .

, :

t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."
t["G"]="--."    t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"
t["N"]="-."     t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"
t["U"]="..-"    t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."

:

t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."
t[""]="."      t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."
t[""]="--"     t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"
t[""]="..-"    t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"
t[""]="-..-"   t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"

, ( ) ( ), , ((

: cirus 28.1.2019, 22:39

,

? .

: FREEON 28.1.2019, 23:01

(cirus @ 28.1.2019, 22:39) *

? .

, . " " "\"
: \
local s=text:gsub(".", t) + \ --
t[""]="-.-" "-.-\"
:

-.-\.-\-.-\\-..\.\.-..\.-\
                 
➀  ➁ ➀ \ ➂ ➃  ➄   ➁

\ , \, , cool.gif
url
%
:%%D0%B1%%D0%BE%%D0%B6%%D1%8D%%D0%BD%%D1%8C%%D0%BA%%D0%B0
:%%%%%%%%
()

: cirus 29.1.2019, 0:50

--lua
log "clear"  log "mode compact"

local text=[[-.-\.-\-.-\\\-..\.\.-..\.-\]]     -- " "
--local text=" "     --  [[-.-\.-\-.-\\\-..\.\.-..\.-\]]
log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"   t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%-%\\]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub(text:gsub("(.-)\\", t1), "\\\\", " ")    --
else
    text=string.gsub(string.gsub(text:gsub("([^ ])", "%1\\"), "%s", "\\\\"), "[^\\]", t)   --
end
log (text)

: FREEON 29.1.2019, 1:18

(cirus @ 29.1.2019, 0:50) *

--lua
log "clear"  log "mode compact"

local text=[[-.-\.-\-.-\\\-..\.\.-..\.-\]]     -- " "
--local text=" "     --  [[-.-\.-\-.-\\\-..\.\.-..\.-\]]
log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"   t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%-%\\]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub(text:gsub("(.-)\\", t1), "\\\\", " ")    --
else
    text=string.gsub(string.gsub(text:gsub("([^ ])", "%1\\"), "%s", "\\\\"), "[^\\]", t)   --
end
log (text)


lua set delimiter ' ' ?

for i, word in pairs(split(text, "<(.-)>")) do
    print(word)
end

function split(string, delimiter) -- Got this function from [url=https://helloacm.com/split-a-string-in-lua/]https://helloacm.com/split-a-string-in-lua/[/url]
    result = {};

    for match in (string..delimiter):gmatch("(.-)"..delimiter) do
        table.insert(result, match);
    end

    return result;
end


This code replaces the parts in the format "<(.-)>"

Example:
Input: "Hello<a>World</a>!"

Expected Output: {"Hello", "<a>", "World", "</a>", "!"}

Real Output: {"Hello", "World", "!"}


s = "Hello<a>World</a>!"
for a in s:gsub('%b<>','\0%0\0'):gmatch'%Z+' do
  print(a)
end

: cirus 29.1.2019, 1:43

lua set delimiter ' ' ?

. ?

: FREEON 29.1.2019, 1:46

(cirus @ 29.1.2019, 1:43) *

. ?

sad.gif
- ...

--lua
function split(s, sep)
    local fields = {}

    local sep = sep or " "
    local pattern = string.format("([^%s]+)", sep)
    string.gsub(s, pattern, function(c) fields[#fields + 1] = c end)

    return fields
end

t = split("a,b,c,d,e,f,g",",")
for i,j in pairs(t) do
    log(i,j)
end


--lua
local arr = {"", "", "", ""}
log (table.concat(arr, " "))    --

http://uopilot.tati.pro/index.php?title=Table.concat_(Lua)

: cirus 29.1.2019, 3:02

, . .

: sutra 29.1.2019, 4:02

, . . - "" . , - -. - , .

: FREEON 29.1.2019, 11:47

(cirus @ 29.1.2019, 3:02) *

, . .

Lua , ... ... mellow.gif
%s --
http://uopilot.tati.pro/index.php?title=String.gsub_(Lua)

: FREEON 29.1.2019, 12:27

(FREEON @ 29.1.2019, 11:47) *

Lua , ... ... mellow.gif
%s --
http://uopilot.tati.pro/index.php?title=String.gsub_(Lua)

- ...

--lua
log "clear"  log "mode compact"

local text=[[..-.. .---  - .- -- ]]     -- " "
--local text=" "     --  [[-.-\.-\-.-\\\-..\.\.-..\.-\]]
log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"   t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%-%(%s)]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub(text:gsub("(.-)(%s)", t1), "(%s)(%s)", " ")    --
else
    text=string.gsub(string.gsub(text:gsub("([^ ])", "%1 "), "%s", " "), "[^ ]", t)   --
end
log (text)

rolleyes.gif

: DarkMaster 29.1.2019, 13:10

in pairs(t)

. next - , .

: cirus 29.1.2019, 13:27

--lua
log "clear"  log "mode compact"

local text=[[-.- .- -.-   -.. . .-.. .-]]     -- " "
--local text=" "     --  [[-.-\.-\-.-\\\-..\.\.-..\.-\]]
log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"   t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%- ]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub((text .. " "):gsub("(.-) ", t1), "  ", " ")    --
else
    text=string.gsub(text:gsub("(.)", "%1 "), "[^ ]", t)  --
end
log (text)

: FREEON 23.4.2019, 22:34

CP1251 UTF-8


--lua
log ("clear")   log ("mode compact")
local q = clipboard ()      -- text

wait (300)                     -- 300
log (q)                     -- text
log()
local t={}
t["А"]="" t["Б"]="" t["В"]="" t["Г"]="" t["Д"]="" t["Е"]="" t["Ё"]="" t["Ж"]="" t["З"]="" t["И"]="" t["Й"]=""
t["К"]="" t["Л"]="" t["М"]="" t["Н"]="" t["О"]="" t["П"]="" t["Р"]="" t["С"]="" t["Т"]="" t["У"]="" t["Ф"]=""
t["Х"]="" t["Ц"]="" t["Ч"]="" t["Ш"]="" t["Щ"]="" t["Ъ"]="" t["Ы"]="" t["Ь"]="" t["Э"]="" t["Ю"]="" t["Я"]=""
t["а"]="" t["б"]="" t["в"]="" t["г"]="" t["д"]="" t["е"]="" t["ё"]="" t["ж"]="" t["з"]="" t["и"]="" t["й"]=""
t["к"]="" t["л"]="" t["м"]="" t["н"]="" t["о"]="" t["п"]="" t["р"]="" t["с"]="" t["т"]="" t["%у"]="" t["ф"]=""
t["х"]="" t["ц"]="" t["ч"]="" t["ш"]="" t["щ"]="" t["ъ"]="" t["ы"]="" t["ь"]="" t["э"]="" t["ю"]="" t["я"]=""
local s = (string.gsub(q, "[]x", t))  -- ???
log (s)
clipboard (s)                  --

:
абвгдеёжзийклмнопрстуфхцчшщъыьэюя
АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ

: FREEON 29.10.2019, 16:14

. file1.txt ():
, * "
, </tr> , <tr> </tr> <tr>
file2.html <!-- 1 --> file1.txt
,

: Fors1k 30.10.2019, 1:59

(FREEON @ 29.10.2019, 16:14) *

. file1.txt ():
, * "
, </tr> , <tr> </tr> <tr>
file2.html <!-- 1 --> file1.txt
,

//-----
set $a *
set $a1 "
set $b </tr> , <tr>
set $b1 </tr> <tr>
set $c "<!-- 1 -->"
//-----
load_array %file1 c:/2/file1.txt
for #i 1 size(%file1)
    set $file1 %file1[#i]
    set %file1[#i] string_replace($file1 $a $a1 all)
    set $file1 %file1[#i]
    set %file1[#i] string_replace($file1 $b $b1 all)
end_for
load_array %file2 c:/2/file2.txt
set #res indexOf(%file2 noabs ($c))
set #nd #res - 1
for #i 1 #nd
    set %file2a[#i] %file2[#i]
end_for
for #i 1 size(%file1)
    set #j #i + #nd
    set %file2a[#j] %file1[#i]
end_for
save_array %file2a c:/2/file2_new.txt
set #res1 #res + 1
for #i #res1 size(%file2)
    write (c:/2/file2_new.txt %file2[#i] \r\n)
end_for
end_script

: FREEON 30.10.2019, 11:27

(Fors1k @ 30.10.2019, 1:59) *


indexOf . ... - .

//-----
set $a *
set $a1 "
set $b </tr> , <tr>
set $b1 </tr> <tr>
set $c "<!-- 1 -->"
//-----
load_array %file1 c:\123.txt
for #i 1 size(%file1)
    set $file1 %file1[#i]
    set %file1[#i] string_replace($file1 $a $a1 all)
    set $file1 %file1[#i]
    set %file1[#i] string_replace($file1 $b $b1 all)
    //write (D:\123\1_rez.txt %file1[#i] \r\n) // .
end_for

load_array %file2 D:\123\2.txt
set #res indexOf(%file2 noabs ($c))
set #nd #res - 1
for #i 1 #nd
    set %file2a[#i] %file2[#i]
end_for
for #i 1 size(%file1)
    set #j #i + #nd
    set %file2a[#j] %file1[#i]
    //write (D:\123\2_new.txt %file2a[#i] \r\n)  // 3() #i #j
end_for
//save_array %file2a D:\123\2_new.txt  // 0
end_script          //
set #res1 #res + 1
for #i #res1 size(%file2)
    write (D:\123\2_new.txt %file2[#i] \r\n)
end_for
end_script

: cirus 30.10.2019, 12:46

. file1.txt ():
, * "
, </tr> , <tr> </tr> <tr>

--lua
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

if file and result_file then     --
    for v in file:lines() do
        local s=v:gsub("*", '"')  --
        s=s:gsub("(</tr>)( , )(<tr>)", "%1 %3")  --
        result_file:write(s .. "\n")
    end

    file:close()
    result_file:close()
else
    log (" /")
end

: Fors1k 30.10.2019, 13:09


indexOf . ... - .

, .

File1
In Winter *I get up* at night
And </tr> , <tr>dress by yellow</tr> , <tr> candle light.
In *Summer, quite the other way,
I have to go to bed by day</tr> , <tr>.

File2
123_abc
456_efg
<!-- 1 -->
789
123qwe123
777 hello

File2_new
123_abc
456_efg
In Winter "I get up" at night
And </tr> <tr>dress by yellow</tr> <tr> candle light.
In "Summer, quite the other way,
I have to go to bed by day</tr> <tr>.

789
123qwe123
777 hello


1 2, .

: FREEON 30.10.2019, 13:30

(Fors1k @ 30.10.2019, 13:09) *

, .

File1

File2

File2_new
1 2, .

, ... :
(27): ! ! EAccessViolation Access violation at address 005531E6 in module uopilot241.exe'. Read of address FFFFFFFC
calc c:/2/file2_new.txt %file2[*i]

: Fors1k 30.10.2019, 13:35

(FREEON @ 30.10.2019, 13:30) *



(FREEON @ 30.10.2019, 13:30) *

calc c:/2/file2_new.txt %file2[*i]

*i =)) .

: FREEON 30.10.2019, 13:48

(Fors1k @ 30.10.2019, 13:35) *

*i =)) .

- . #i file2_new.txt 2 file2
file2_new.txt

In "Summer, quite the other way,
I have to go to bed by day</tr> <tr>.

: Fors1k 30.10.2019, 14:46

(FREEON @ 30.10.2019, 13:48) *

.

.

[+]

: FREEON 30.10.2019, 15:41

(Fors1k @ 30.10.2019, 14:46) *

.

[+]


... ... _

: FREEON 30.10.2019, 18:15

(FREEON @ 30.10.2019, 15:41) *

... ... _

) , , fele2.txt .
- .

: cirus 31.10.2019, 1:26

?

: FREEON 31.10.2019, 7:04

(cirus @ 31.10.2019, 1:26) *

?

lua. , , , . .
( ), - lua? ...

: Fors1k 31.10.2019, 8:04

(FREEON @ 30.10.2019, 18:15) *



, )

: FREEON 31.10.2019, 9:33

(Fors1k @ 31.10.2019, 8:04) *

, )

#i_1.txt * " </tr> , <tr> </tr> <tr>
#i_2.txt * " </tr> , <tr> </tr> <tr>
#i.html <!-- 1 --> #i_1.txt <!-- 2 --> #i_2.txt
  test.zip ( 351,99 ) - : 274

: cirus 31.10.2019, 11:37

--lua
local file = io.open([[C:\1_1.txt]], "r")          --
local file2 = io.open([[C:\1.html]], "r")          --
local result_file = io.open([[C:\1_1z.txt]], "w")  --
local result_file2 = io.open([[C:\1z.html]], "w")  --

if file and result_file and file2 and result_file2 then     --
        local s2, s = ""
        for v in file:lines() do    --
            s=v:gsub("*", '"')  --
            s=s:gsub("(</tr>)( , )(<tr>)", "%1 %3")  --
            result_file:write(s .. "\n")
        end

        for v in file2:lines() do s2=s2 .. v end    --
        result_file2:write(s2:gsub("<!%-%- 1 %-%->", s))   --
        file:close()   file2:close()    result_file:close()   result_file2:close()  --
else
    log (" /")
end

: Fors1k 31.10.2019, 15:49

(FREEON @ 31.10.2019, 9:33) *

#i_1.txt * " </tr> , <tr> </tr> <tr>
#i_2.txt * " </tr> , <tr> </tr> <tr>
#i.html <!-- 1 --> #i_1.txt <!-- 2 --> #i_2.txt
  test.zip ( 351,99 ) - : 274


, .
load_array %file3 c:/2/11.html                 //   
load_array %file c:/2/11_1.txt                 // 1
set #res indexOf(%file3 noabs ("<!-- 1 -->"))  // 1
gosub zamena
load_array %file c:/2/11_2.txt                 // 2
set #res indexOf(%file3 noabs ("<!-- 2 -->"))  // 2
gosub zamena
save_array %file3 c:/2/11_new.html             //
end_script
:zamena                                        //
    set $file %file[1]
    set $file string_replace($file * " all)
    set $file string_replace($file "</tr> , <tr>" "</tr> <tr>" all)
    set %file3[#res] $file
return


?
?

: FREEON 1.11.2019, 1:26

(Fors1k @ 31.10.2019, 15:49) *

, .
load_array %file3 c:/2/11.html                 //   
load_array %file c:/2/11_1.txt                 // 1
set #res indexOf(%file3 noabs ("<!-- 1 -->"))  // 1
gosub zamena
load_array %file c:/2/11_2.txt                 // 2
set #res indexOf(%file3 noabs ("<!-- 2 -->"))  // 2
gosub zamena
save_array %file3 c:/2/11_new.html             //
end_script
:zamena                                        //
    set $file %file[1]
    set $file string_replace($file * " all)
    set $file string_replace($file "</tr> , <tr>" "</tr> <tr>" all)
    set %file3[#res] $file
return


?
?

. . ... . , !

: FREEON 18.11.2021, 14:36

( ). . : " .txt" , .

--lua
log "clear" log "mode compact"
local path = [[D:\_NHL\End]]      --
local POISK, count = dir (path, "*.txt", "norecursion")  -- 'txt',
log (" : " .. count)
if count then      --
    for i=1, #POISK do
        log (" : " ..POISK[i][1])         --
        local OldName = POISK[i][3]          --
        log (" : " ..OldName)
        local t = {}
        t[""]="A"     t[""]="B"   t[""]="V"    t[""]="G"    t[""]="D"    t[""]="E"    t[""]="E"
        t[""]="ZH"    t[""]="Z"   t[""]="I"    t[""]="Y"    t[""]="K"    t[""]="L"    t[""]="M"
        t[""]="N"     t[""]="O"   t[""]="P"    t[""]="R"    t[""]="S"    t[""]="T"    t[""]="U"
        t[""]="F"     t[""]="KH"  t[""]="TS"   t[""]="CH"   t[""]="SH"   t[""]="SHCH" t[""]=""
        t[""]=""      t[""]="Y"   t[""]="E"    t[""]="YU"   t[""]="YA"
        t[""]="a"     t[""]="b"   t[""]="v"    t[""]="g"    t[""]="d"    t[""]="e"    t[""]="e"
        t[""]="zh"    t[""]="z"   t[""]="i"    t[""]="y"    t[""]="k"    t[""]="l"    t[""]="m"
        t[""]="n"     t[""]="o"   t[""]="p"    t[""]="r"    t[""]="s"    t[""]="t"    t[""]="u"
        t[""]="f"     t[""]="kh"  t[""]="ts"   t[""]="ch"   t[""]="sh"   t[""]="shch" t[""]=""
        t[""]=""      t[""]="y"   t[""]="e"    t[""]="yu"   t[""]="ya"
        t[" "]="-" --
        local NewName = string.gsub(OldName, "(.)", t)  -- 't'
        log (" : " ..NewName)
        local NewPathAndName = POISK[i][2]..NewName..POISK[i][4]
        log (" . : " ..NewPathAndName)
        filerename (POISK[i][1], NewPathAndName)  -- .txt Ivanov.txt
        log ("---")
    end
end

: cirus 18.11.2021, 14:53

.

--lua
log 'clear' log 'mode compact'
local OldName = "C:\\test.txt"
local NewName = "C:\\ .txt"

log ( NewName )
log ( string.format("%q", NewName) )

filerename (string.format("%q", OldName) , string.format("%q", NewName))



Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)