Project1
标题:
求助高手啊 在线========啊
[打印本页]
作者:
thwangaoxl
时间:
2010-6-18 20:14
标题:
求助高手啊 在线========啊
这貌似是个网游的脚本
进入游戏到了输入账号密码的地方后会提示
1.jpg
(7.58 KB, 下载次数: 14)
下载附件
保存到相册
2010-6-18 20:12 上传
按确定后弹出
2.jpg
(13.77 KB, 下载次数: 14)
下载附件
保存到相册
2010-6-18 20:12 上传
即下面的代码
module Mouse
#============================================================================
# 设置
#============================================================================
# 动画的图片格式
FORMAT_ANIMSRC_FRAMES_PER_ROW = 5; # 每一行几帧
FORMAT_ANIMSRC_WIDTH_PER_FRAME = 40; # 每一帧对应的图像宽度
FORMAT_ANIMSRC_HEIGHT_PER_FRAME = 28; # 每一帧对应的图像高度
# 动画图片的数组枚举 (如果自己知道哪里是什么动画, 也可以不要用)
ENUM_SCENE_MAP_MOUSELBUTTON_DOWN_ANIM_INDEX = 0 ; # 地图的鼠标动画的索引
# 动画的数据, 这5个彼此一一对应
@@mouseAnimGraphics = [nil];
@@mouseAnimFrame = [8];
@@mouseAnimDurationPerFrame = [8];
@@mouseAnimTimes = [3];
@@mouseAnimTotalDuration = [0];
@@mouseAnimInScreen = [false];
@@mouseMapCoord = [[], []];
#============================================================================
# 设置
#============================================================================
def self.SetAnim(index, sprite, screen = false, frame = 8, durationPerFrame = 8)
if (nil != @@mouseAnimGraphics[index])
@@mouseAnimGraphics[index].dispose();
end
@@mouseAnimGraphics[index] = sprite;
@@mouseAnimGraphics[index].src_rect.set(0, 0,
FORMAT_ANIMSRC_WIDTH_PER_FRAME,
FORMAT_ANIMSRC_HEIGHT_PER_FRAME
);
@@mouseAnimInScreen[index] = screen;
@@mouseAnimGraphics[index].visible = false;
@@mouseAnimFrame[index] = frame;
@@mouseAnimDurationPerFrame[index] = durationPerFrame;
@@mouseAnimTotalDuration[index] = 0;
@@mouseMapCoord[0][index] = 0;
@@mouseMapCoord[1][index] = 0;
end
def self.StartAnim(index, x, y, times = 2)
if (nil == @@mouseAnimGraphics[index])
return false;
end
if (@@mouseAnimInScreen[index])
@@mouseAnimGraphics[i].x = x;
@@mouseAnimGraphics[i].y = y;
else
@@mouseMapCoord[0][index] = x;
@@mouseMapCoord[1][index] = y;
end
@@mouseAnimGraphics[index].visible = true;
@@mouseAnimTotalDuration[index] = @@mouseAnimFrame[index] *
@@mouseAnimDurationPerFrame[index];
@@mouseAnimTimes[index] = times;
return true;
end
# 更新所有动画
def self.UpdateAnim()
@@mouseAnimTotalDuration.each_index{
|i|
if (0 >= @@mouseAnimTotalDuration[i])
@@mouseAnimGraphics[i].visible = false;
next;
end
@@mouseAnimTotalDuration[i] -= 1;
if (!@@mouseAnimInScreen[i])
@@mouseAnimGraphics[i].x = (((@@mouseMapCoord[0][i]<<7) - $game_map.display_x + 3)>>2) + 16;
@@mouseAnimGraphics[i].y = (((@@mouseMapCoord[1][i]<<7) - $game_map.display_y + 3)>>2) + 32;
end
if (0 == (@@mouseAnimTotalDuration[i] % @@mouseAnimDurationPerFrame[i]))
bmpRectIndex = @@mouseAnimTotalDuration[i] /
@@mouseAnimDurationPerFrame[i];
bmpRectIndexW = bmpRectIndex % FORMAT_ANIMSRC_FRAMES_PER_ROW;
bmpRectIndexH = bmpRectIndex / FORMAT_ANIMSRC_FRAMES_PER_ROW;
@@mouseAnimGraphics[i].src_rect.set(
bmpRectIndexW * FORMAT_ANIMSRC_WIDTH_PER_FRAME,
bmpRectIndexH * FORMAT_ANIMSRC_HEIGHT_PER_FRAME,
FORMAT_ANIMSRC_WIDTH_PER_FRAME, FORMAT_ANIMSRC_HEIGHT_PER_FRAME
);
end
}
end
# 更新指定的动画
def self.UpdateAnimSpecial(indexArr)
indexArr.each{
|i|
if (0 >= @@mouseAnimTotalDuration[i])
@@mouseAnimTimes[i] -= 1;
if (0 >= @@mouseAnimTimes[i])
@@mouseAnimGraphics[i].visible = false;
else
@@mouseAnimTotalDuration[i] = @@mouseAnimFrame[i] *
@@mouseAnimDurationPerFrame[i];
end
next;
end
@@mouseAnimTotalDuration[i] -= 1;
if (!@@mouseAnimInScreen[i])
@@mouseAnimGraphics[i].x = (((@@mouseMapCoord[0][i]<<7) - $game_map.display_x + 3)>>2) + 16;
@@mouseAnimGraphics[i].y = (((@@mouseMapCoord[1][i]<<7) - $game_map.display_y + 3)>>2) + 32;
end
if (0 == (@@mouseAnimTotalDuration[i] % @@mouseAnimDurationPerFrame[i]))
bmpRectIndex = @@mouseAnimTotalDuration[i] /
@@mouseAnimDurationPerFrame[i];
bmpRectIndexW = bmpRectIndex % FORMAT_ANIMSRC_FRAMES_PER_ROW;
bmpRectIndexH = bmpRectIndex / FORMAT_ANIMSRC_FRAMES_PER_ROW;
@@mouseAnimGraphics[i].src_rect.set(
bmpRectIndexW * FORMAT_ANIMSRC_WIDTH_PER_FRAME,
bmpRectIndexH * FORMAT_ANIMSRC_HEIGHT_PER_FRAME,
FORMAT_ANIMSRC_WIDTH_PER_FRAME, FORMAT_ANIMSRC_HEIGHT_PER_FRAME
);
end
}
end
# 等待完成的更新
def self.UpdateAnimWait(indexArr, wait)
indexArr.each{
|i|
if (0 >= @@mouseAnimTotalDuration[i])
@@mouseAnimTimes[i] -= 1;
if (wait)
@@mouseAnimTotalDuration[i] = @@mouseAnimFrame[i] *
@@mouseAnimDurationPerFrame[i];
if (0 >= @@mouseAnimTimes[i])
@@mouseAnimTimes[i] = 1
end
else
@@mouseAnimTotalDuration[i] = @@mouseAnimTimes[i] = 0;
end
if (0 >= @@mouseAnimTimes[i])
@@mouseAnimGraphics[i].visible = false;
end
next;
end
@@mouseAnimTotalDuration[i] -= 1;
if (!@@mouseAnimInScreen[i])
@@mouseAnimGraphics[i].x = (((@@mouseMapCoord[0][i]<<7) - $game_map.display_x + 3)>>2) + 16;
@@mouseAnimGraphics[i].y = (((@@mouseMapCoord[1][i]<<7) - $game_map.display_y + 3)>>2) + 32;
end
if (0 == (@@mouseAnimTotalDuration[i] % @@mouseAnimDurationPerFrame[i]))
bmpRectIndex = @@mouseAnimTotalDuration[i] /
@@mouseAnimDurationPerFrame[i];
bmpRectIndexW = bmpRectIndex % FORMAT_ANIMSRC_FRAMES_PER_ROW;
bmpRectIndexH = bmpRectIndex / FORMAT_ANIMSRC_FRAMES_PER_ROW;
@@mouseAnimGraphics[i].src_rect.set(
bmpRectIndexW * FORMAT_ANIMSRC_WIDTH_PER_FRAME,
bmpRectIndexH * FORMAT_ANIMSRC_HEIGHT_PER_FRAME,
FORMAT_ANIMSRC_WIDTH_PER_FRAME, FORMAT_ANIMSRC_HEIGHT_PER_FRAME
);
end
}
end
# 不消除动画的更新
def self.UpdateAnimWait_Visible(indexArr, wait)
indexArr.each{
|i|
if (0 >= @@mouseAnimTotalDuration[i])
@@mouseAnimTimes[i] -= 1;
if (wait)
@@mouseAnimTotalDuration[i] = @@mouseAnimFrame[i] *
@@mouseAnimDurationPerFrame[i];
if (0 >= @@mouseAnimTimes[i])
@@mouseAnimTimes[i] = 1
end
else
@@mouseAnimTotalDuration[i] = @@mouseAnimTimes[i] = 0;
end
if (0 >= @@mouseAnimTimes[i])
@@mouseAnimGraphics[i].visible = false;
end
next;
end
@@mouseAnimTotalDuration[i] -= 1;
if (!@@mouseAnimInScreen[i])
@@mouseAnimGraphics[i].x = (((@@mouseMapCoord[0][i]<<7) - $game_map.display_x + 3)>>2) + 1;
@@mouseAnimGraphics[i].y = (((@@mouseMapCoord[1][i]<<7) - $game_map.display_y + 3)>>2) + 8;
end
if (0 == (@@mouseAnimTotalDuration[i] % @@mouseAnimDurationPerFrame[i]))
bmpRectIndex = @@mouseAnimTotalDuration[i] /
@@mouseAnimDurationPerFrame[i];
bmpRectIndexW = bmpRectIndex % FORMAT_ANIMSRC_FRAMES_PER_ROW;
bmpRectIndexH = bmpRectIndex / FORMAT_ANIMSRC_FRAMES_PER_ROW;
@@mouseAnimGraphics[i].src_rect.set(
bmpRectIndexW * FORMAT_ANIMSRC_WIDTH_PER_FRAME,
bmpRectIndexH * FORMAT_ANIMSRC_HEIGHT_PER_FRAME,
FORMAT_ANIMSRC_WIDTH_PER_FRAME, FORMAT_ANIMSRC_HEIGHT_PER_FRAME
);
end
}
end
def self.ResetAnim(index)
@@mouseAnimTotalDuration[index] = @@mouseAnimFrame[index] *
@@mouseAnimDurationPerFrame[index];
end
def self.GetAnimTotalDuration(index)
return @@mouseAnimTotalDuration[index];
end
def self.ReleaseAnim()
@@mouseAnimGraphics.each{
|sprite|
next if (nil == sprite);
sprite.dispose;
sprite = nil;
}
end
def self.TransMousPosToMapCoord()
x, y = Mouse.get_mouse_pos();
return [($game_map.display_x>>7) + (x>>5), ($game_map.display_y>>7) + (y>>5)];
end
def self.GetAnimTransCoord(index)
return [@@mouseMapCoord[0][index], @@mouseMapCoord[1][index]];
end
end
#=====================================================
# 添加鼠标动画的方法
spr = Sprite.new;
spr.z = 99999999;
spr.bitmap = Bitmap.new("mousepp.png");
Mouse.SetAnim(Mouse::ENUM_SCENE_MAP_MOUSELBUTTON_DOWN_ANIM_INDEX, spr);
END{Mouse.ReleaseAnim();}
class Scene_Map
alias updateMouseAnim update
def update
updateMouseAnim;
x, y = Mouse.get_mouse_pos();
Mouse.UpdateAnimWait_Visible([Mouse::ENUM_SCENE_MAP_MOUSELBUTTON_DOWN_ANIM_INDEX],
$game_player.moving?);
if (Mouse.press?(Mouse::LEFT))
sprX, sprY = Mouse.TransMousPosToMapCoord()
Mouse.StartAnim(Mouse::ENUM_SCENE_MAP_MOUSELBUTTON_DOWN_ANIM_INDEX,
sprX, sprY);
end
end
end
复制代码
220行为 spr.bitmap = Bitmap.new("mousepp.png");
求高手指教啊 在线=========啊
作者:
神思
时间:
2010-6-18 20:27
缺少mousepp.png文件....
作者:
行雲流水
时间:
2010-6-18 21:32
提示:
作者被禁止或删除 内容自动屏蔽
作者:
wxx45600
时间:
2010-6-18 22:07
SORRY I AM...新手啊
作者:
kukurui00
时间:
2010-6-19 06:59
建个SAVE的文件夹就行了
作者:
逆鳞R
时间:
2010-6-19 12:45
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1