马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
本帖最后由 ai188 于 2025-5-19 21:55 编辑
帮忙修改个脚本 在V6 版本中运行不了 { :global hex ("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F") /interface wireless :local lini [find default-name~"wifi-vpn-"] :local maci ($hex . $hex) :global macrun 0 :local linkname :local a :local b :local c :local d :local i 1 :local starttime [/system resource get uptime] :local startuptime [:tonum $starttime] :local starthour (($startuptime / 3600) % 24) :local startminute (($startuptime / 60) % 60) :local startsecond ($startuptime % 60) :foreach ii in=$lini do={ :set linkname [get $ii name] :local currenttime [/system clock get time] :local currenthour [:pick $currenttime 0 2] :local currentminute [:pick $currenttime 3 5] :local currentsecond [:pick $currenttime 6 8] :set a [:pick $maci (($starthour + $currenthour) % 256)] :set b [:pick $maci (($startminute + $currentminute) % 256)] :set c [:pick $maci (($startsecond + $currentsecond) % 256)] :set d [:pick $maci ($i % 256)] :set i ($i + 1) :local newmac ("04:6C:9D:" . $a . ":" . $b . ":" . $c) :log warning ("Set $linkname Mac $newmac") :put ("Set $linkname Mac $newmac") # 使用 :set 命令设置 MAC 地址 set $ii mac-address=$newmac :delay 2s } }
|