吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 741|回复: 30
上一主题 下一主题
收起左侧

[原创工具] 一个随机发送文字的小工具

  [复制链接]
跳转到指定楼层
楼主
nfsyan 发表于 2025-3-16 15:31 回帖奖励
不知道大家有没有遇到过这样的场景 ,就是批量发送评价或者在游戏中随机发送文字。
正好我今天遇见了,于是写了一个,界面很简单就是加载一个文本文件的选择框,一个随机模式复选框(如果不勾选 则会顺序发送),一个是否在粘贴后自动按下回车发送的复选框。
没有设置修改快捷键的功能,默认F1。需要改的在下面回帖或者自己去改源码吧。(ahk编写)

主要功能就是从加载的文本文件中选一行,粘贴进当前的输入框。


下载地址
https://wwyn.lanzout.com/iv4YX2qr469a


脚本如下:
; 初始化配置
#SingleInstance Force
#NoEnv
SetWorkingDir %A_ScriptDir%

global currentMode := 1    ; 1=随机模式,0=顺序模式
global autoEnter := 0
global dataPath := A_ScriptDir "\data.txt"
global currentIndex := 1

; 加载配置
IniRead, savedDataPath, settings.ini, config, dataPath, %dataPath%
IniRead, savedMode, settings.ini, config, mode, 1
IniRead, savedAutoEnter, settings.ini, config, autoenter, 0

; 创建GUI
Gui, +AlwaysOnTop +OwnDialogs
Gui, Font, s10

; 文件选择按钮
UpdateFileDisplay()
Gui, Add, Button, x10 y10 w180 h30 gSelectFile vFileButton, %currentFileDisplay%

; 功能选项
Gui, Add, Checkbox, x10 y50 vRandomMode Checked%currentMode% gUpdateMode, 随机模式
Gui, Add, Checkbox, x100 y50 vAutoEnter Checked%autoEnter% gUpdateAutoEnter, 自动回车
Gui, Add, Text, x10 y80 w180 Center, 按 F1 键粘贴内容
Gui, Show, w200 h120, 文本助手

; 应用配置
ApplyConfig()
return

;========= 核心功能 =========
F1::
    if !FileExist(dataPath) {
        MsgBox 0x40010, 错误, 请先选择有效文件!
        return
    }
   
    file := FileOpen(dataPath, "r", "UTF-8")
    content := file.Read()
    file.Close()
   
    ; 统一换行符
    content := StrReplace(content, "`r", "")
    lines := StrSplit(content, "`n")
   
    ; 过滤空行
    filtered := []
    for _, line in lines {
        if (Trim(line) != "")
            filtered.Push(Trim(line))
    }
   
    if !filtered.Length() {
        MsgBox 0x40010, 错误, 文件内容为空!
        return
    }
   
    ; 选择内容逻辑
    if (currentMode) {
        Random, index, 1, filtered.Length()
    } else {
        index := currentIndex
        currentIndex := (currentIndex >= filtered.Length()) ? 1 : currentIndex + 1
    }
   
    ; 执行粘贴
    Clipboard := filtered[index]
    Send ^v
    if (autoEnter)
        Send {Enter}
return

;========= 配置函数 =========
ApplyConfig() {
    global
    dataPath := FileExist(savedDataPath) ? savedDataPath : dataPath
    currentMode := savedMode is digit ? savedMode : 1  ; 修复配置类型问题
    autoEnter := savedAutoEnter
    currentIndex := 1
    UpdateFileDisplay()
}

UpdateFileDisplay() {
    global dataPath
    SplitPath, dataPath, fileName
    currentFileDisplay := fileName ? fileName : "点击选择文件"
    GuiControl, , FileButton, 当前文件:%currentFileDisplay%
}

;========= 事件响应 =========
SelectFile:
    FileSelectFile, selectedFile, 3, %A_ScriptDir%, 选择文本文件, *.txt
    if selectedFile {
        dataPath := selectedFile
        IniWrite, %dataPath%, settings.ini, config, dataPath
        UpdateFileDisplay()
        currentIndex := 1  ; 切换文件时重置顺序索引
    }
return

UpdateMode:
    Gui, Submit, NoHide
    currentMode := RandomMode  ; 直接使用复选框的布尔值
    IniWrite, %currentMode%, settings.ini, config, mode
    if !currentMode  ; 切换到顺序模式时重置索引
        currentIndex := 1
return

UpdateAutoEnter:
    Gui, Submit, NoHide
    IniWrite, %autoEnter%, settings.ini, config, autoenter
return

GuiClose:
ExitApp

免费评分

参与人数 6吾爱币 +11 热心值 +6 收起 理由
monsoon989 + 1 + 1 我很赞同!
feixiang785 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
yanglinman + 1 谢谢@Thanks!
nowandtime + 1 + 1 我很赞同!
wojaiyh + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
风之暇想 + 7 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

推荐
Sandyang 发表于 2025-3-16 22:14
本帖最后由 Sandyang 于 2025-3-16 22:17 编辑

不错,可惜少了个功能,容易给封号,最好加上自定义时间段,例如多少分钟内,例如最低10秒,最高3分钟,在这段时间内来个随机值发送,这样才不会被机器查出来

例如我的脚本:


沙发
wojaiyh 发表于 2025-3-16 17:19
3#
nowandtime 发表于 2025-3-16 18:09
4#
s120900225 发表于 2025-3-16 18:30
支持原创~!!!
5#
a418141216 发表于 2025-3-16 19:23
向优秀的你学习,谢谢你的分享。
6#
ghfhgk 发表于 2025-3-16 19:31
感谢分享 谢谢
7#
w59450 发表于 2025-3-16 19:34
好像有点意思,支持一下
8#
AntelopeE 发表于 2025-3-16 19:38
向优秀的你学习,谢谢你的分享
9#
feixiang785 发表于 2025-3-16 19:49
有创意的原创
10#
yfl 发表于 2025-3-16 20:16
说说应用场景
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-3-17 08:14

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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