Skip to content

Commit

Permalink
feat 添加宝图功能
Browse files Browse the repository at this point in the history
  • Loading branch information
kaykie committed Apr 19, 2024
1 parent d7dedf4 commit 43d1e3b
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 4 deletions.
2 changes: 1 addition & 1 deletion autoWebview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable */
'ui';
// 一. 开发使用本地地址调试
initUi('http://192.168.83.108:5666/')
initUi('http://192.168.170.108:5666/')
// initUi('http://172.21.32.205:5666/')

// 二.上线
Expand Down
Binary file added images/shiYong.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/xhao3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/waTu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/auto/robot/robot.fiveBen.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function isFight(){

// 在副本战斗中,在点击进入战斗的时候 可能会出现对话 需要快速跳过
function isFuBengFight(){
if(isHasImageTemplate('fuBengFight.jpg')){
if(isHasImageTemplate('fuBengFight.jpg') || hasText('点击任意') || hasText('任意地方') || hasText('地方继续')){
// 因为副本在进入在战斗的时候 可能会出现对话
for(var i = 0; i<8;i++){
randomClick()
Expand Down
27 changes: 27 additions & 0 deletions src/auto/robot/robot.waTu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 挖图脚本
auto();

const {findTextAndClick,loopFunction,isHasImageTemplate,isFighting,randomClick,clickImageTemplate,hasText,findTextRect} = require('util.js')
toastLog('挖图脚本执行中...')

while(true){
if(isFighting()){
log('战斗中...')
sleep(5000)
}
sleep(500)
var res = loopFunction(function(){
sleep(1000)
return findTextAndClick('使用',{region:'rightBottomHalf'})
},55)
if(!res){
// 由于加图片得更新包,后续再更新用图片找使用功能
// var res3 = loopFunction(function(){
// return clickImageTemplate('shiYong.jpg',{region:'rightBottomHalf'})
// },12)
// if(!res3){
// }
break
}
}
toastLog('挖图脚本执行结束')
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import './flexable'
import router from './router'
import './store'
import vant from 'vant'
import 'vant/es/dialog/style';

// 初始化autojs 全局函数
auto.execAjCode(require('@/auto/global/robot.global'))
auto.execAjCode(require('@/auto/global/robot.menu'))
Expand Down
5 changes: 5 additions & 0 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ const routes = [
name: 'paTa',
component: () => import('./views/home/paTa.vue'),
},
{
path: '/waTu',
name: 'waTu',
component: () => import('./views/home/waTu.vue'),
},
{
path: '/qiang',
name: 'qiang',
Expand Down
30 changes: 28 additions & 2 deletions src/views/home/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<div class="home">

<div class="list">
<div :class="'item ' + item.class" v-for="item in list" @click="goPage(item)">
{{ item.title }}
Expand All @@ -10,13 +9,15 @@
<van-button class="item" type="primary" block @click="handleTest">测试按钮</van-button>
</div>
</div>

</template>
<script>
import store from '@/store';
import {Dialog} from 'vant'
export default {
data () {
return {
version:'0.2.0',
isShowDialog:false,
store,
list: [
{
Expand Down Expand Up @@ -61,6 +62,12 @@ export default {
title: '抢铅',
icon: 'van-icon-chat-o'
},
{
route: 'waTu',
class: 'bg-pink',
title: '挖普通图',
icon: 'van-icon-chat-o'
},
{
route: 'xingGuang',
class: 'bg-blue',
Expand All @@ -71,7 +78,22 @@ export default {
isDev:true
}
},
components:{
Dialog
},
mounted () {
const versionInfo = JSON.parse(localStorage.getItem('versionInfo') || '{}');
if(versionInfo.version !== this.version){
this.isShowDialog = true
Dialog.alert({
title: `${this.version}功能`,
message: '1. 更新挖图功能 \n2.五本战斗时,添加【点击任意地方继续】判断',
theme: 'round-button',
}).then(() => {
// on close
localStorage.setItem('versionInfo',JSON.stringify({version:this.version}))
});
}
this.isDev = process.env.NODE_ENV === 'development'
},
methods: {
Expand Down Expand Up @@ -107,7 +129,11 @@ export default {
.img{
width: 200px;
}
}
.van-dialog__message{
text-align: left;
}
.list{
display:flex;
flex-wrap:wrap;
Expand Down
50 changes: 50 additions & 0 deletions src/views/home/waTu.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<div class="container">
<h3>使用前置:</h3>
<p>1、进入本页面,点击【开始执行】(确定要运行的脚本)</p>
<p>2、启动梦幻西游手游app</p>
<p>3、进入游戏点击普通宝图,等到弹出【使用】</p>
<img src="@/assets/img/waTu.jpg"/>
<p>4、点击悬浮窗口【开始】按钮即可</p>
<van-button round block @click="startNow" type="primary" native-type="submit">
开始执行
</van-button>
</div>
</template>
<script>
export default {
data () {
return {
model: {
},
}
},
mounted () { },
unmounted () {
},
methods: {
startNow () {
auto.invoke(
'runRobot',
[{ robot: require('@/auto/robot/robot.waTu') }],
() => {
// log('ajFun1 回调:', typeof r, r)
},
)
},
stop () {
auto.invoke('robotStop', [], () => { })
},
},
}
</script>
<style lang="less" scoped>
.container{
:deep(.van-radio-group){
margin: 10px;
.van-radio{
margin-bottom: 10px;
}
}
}
</style>
4 changes: 4 additions & 0 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ function clickClosePoint(){
log('有一个x号,点击关闭,这个x号是擂台提示的');
sleep(1500)
clickImageTemplate('xhao2.jpg',{region:'rightHalf'})
}else if(isHasImageTemplate('xhao3.jpg'){
log('有一个x号,点击关闭,这个x号是擂台提示的');
sleep(1500)
clickImageTemplate('xhao3.jpg')
}else{
break;
}
Expand Down

0 comments on commit 43d1e3b

Please sign in to comment.